Skip to content
ENExplore Calculators

Feature Count vs Sample Ratio Calculator

Work out feature count vs sample ratio instantly with clear inputs, formula shown and shareable results.

About Feature Count vs Sample Ratio Calculator

The ratio of samples to features controls how much a model can overfit. With fewer samples than features a linear model can fit the training data perfectly and generalise not at all, which is why the classical guidance is at least ten observations per predictor and twenty for logistic regression with rare events. Below that, regularisation or dimensionality reduction is not optional.

Formula

Sample to feature ratio

ratio = samples / features; recommended samples = features x target ratio

Worked example

With the default values below, Feature Count vs Sample Ratio Calculator returns Samples per feature of 25.00. Change any input above and every figure here is recalculated in your browser.

Inputs used

Number of featuresminimum 1
120
Number of training samplesminimum 1
3,000
Target samples per featureminimum 1
10

Results

Samples per feature
25.00
Samples needed to hit the target ratio
1,200
Additional samples required
0
Assessment
Comfortable - ratio meets the target

Step by step

  1. 1Values used
  2. 2Sample to feature ratio
  3. 3Samples per feature= 25.00
  4. 4Samples needed to hit the target ratio= 1,200
  5. 5Additional samples required= 0
  6. 6Assessment= Comfortable - ratio meets the target

Assumptions and limits

  • The result is derived only from the 3 inputs listed above. Anything not among them is not part of the calculation.
  • In particular, this calculator does not take inflation, tax, fees or charges or compounding frequency into account.
  • Figures are rounded for display to 2 decimal places, so totals built from several rounded parts can differ slightly from the unrounded arithmetic.

How these calculators are built and tested is described on the Methodology page. If a figure looks wrong, please report it.

Frequently Asked Questions

Does this apply to high-dimensional text or genomics data?

Those problems routinely have far more features than samples and rely on strong regularisation such as L1, or on dimensionality reduction. The ratio then tells you how much regularisation you need, not whether to proceed.

Do one-hot encoded categories count as features?

Yes, each level becomes a column. A postcode field can turn one nominal feature into thousands, which is where ratios collapse without you noticing.

Feature Count vs Sample Ratio Calculator | Calcrivo