skip to content

Going from 2 features to 10 at the same data density, how many more training rows do you need?

level: juniorimportance: should knowfreq 50%

answer

  1. count cells, not features
  2. ten bins per feature, then multiply
  3. 10^2 cells versus 10^10 cells
  4. growth is b to the power d

basics

~20 s

About a hundred million times more. Splitting each feature into ten bins gives 100 cells with 2 features and ten billion with 10, and the requirement grows like bins raised to the power of the feature count.

solid answer

~40 s

Density is counted per region of the feature space, and the number of regions multiplies with every feature you add. Cut each feature into ten bins: two features give `10^2 = 100` cells, ten features give `10^10 = 10,000,000,000` cells. To keep the same average number of rows in each cell you need `10^8` — a hundred million — times as much data. The general form is `b^d` for `b` bins and `d` features, which is exponential in the number of features rather than linear. The practical reading is that data collection cannot outrun added dimensions: a dataset that comfortably covers a handful of features is essentially empty once you have a few dozen, which is why any method that relies on a genuinely *local* neighbourhood degrades and why cutting dimensions beats gathering rows.

go deeper

for a junior

Be ready to do the multiplication out loud: ten bins per feature means ten to the power of the feature count, so two features give 100 cells and ten give ten billion. State that the growth is exponential, not linear.

for a middle

Explain why this makes a neighbourhood non-local: nearly every cell is empty, so the k closest rows span most of the range of every feature. Connect the arithmetic to which model families need local density and which do not.

for a senior

Use the argument to push back on feature bloat. Show that you would ask which candidate features carry signal instead of budgeting for more rows, since collection scales linearly while the requirement scales exponentially.

for a principal

Frame it as a resource decision: an exponential requirement cannot be bought. Own the choice between investing in fewer, better-designed features and switching to a model family whose assumptions replace the density the data will never have.

## The arithmetic "Density" here means rows per region of the feature space. Pick a resolution — say ten equal bins along each feature — and count the regions: ``` d = 1 -> 10 cells d = 2 -> 10^2 = 100 cells d = 3 -> 10^3 = 1,000 cells d = 10 -> 10^10 = 10,000,000,000 cells ``` Going from 2 features to 10 multiplies the number of cells by `10^10 / 10^2 = 10^8`. Holding the average number of rows per cell fixed therefore means holding `n / b^d` fixed, so `n` must be multiplied by a hundred million as well. If 1,000 rows gave a comfortable ten rows per cell in two dimensions, ten dimensions would need 100 billion rows for the same comfort. The general statement: **the sample size needed to maintain a fixed resolution grows like `b^d`, exponentially in the number of features.** The choice of ten bins is arbitrary and does not change the shape of the result — with five bins per feature it is `5^d`, still exponential. What matters is that each feature *multiplies* the space rather than adding to it. ## What this means in practice Real datasets in more than a handful of dimensions are almost entirely empty. Nearly every cell contains zero rows, and the ones that are occupied hold one. Any method that estimates something from the points *near* a query — nearest neighbours, kernel smoothing, histogram-style density estimates, a decision tree split deep enough to isolate a small region — is quietly asking for a locally dense sample it does not have. The neighbourhood it actually finds spans a large fraction of the range of every feature, which is a fancy way of saying the prediction is not local at all. A second, related fact about wide spaces is that the data sits near the boundary. In a unit cube, the fraction of the volume within 0.1 of an edge along at least one axis is `1 - 0.8^d`: about 36 percent at `d = 2`, 89 percent at `d = 10`, and essentially all of it by `d = 50`. So most query points are near a face of the space, where their neighbours are one-sided and prediction becomes extrapolation rather than interpolation. ## What it does not mean It does not mean every wide dataset is hopeless. The exponent that matters is the **intrinsic** dimension — the number of directions the data genuinely varies along. Strongly correlated columns, or data lying on a low-dimensional surface inside a high-dimensional space, mean the effective exponent is far smaller than the column count. It also does not condemn every model: methods that impose a strong global structure, like a linear model, do not need a dense local neighbourhood, because they pool information from the whole dataset to estimate a handful of parameters. The exponential requirement is the price of *not* assuming a form for the function. ## What to do with the number in an interview The useful takeaway is a direction of action, not the digit count. When someone proposes adding fifty more candidate features to a distance-based or otherwise local model, the exponential-sample argument is why the right response is to ask which of them carry signal, rather than to ask for more rows. Data collection scales linearly at best; the requirement scales exponentially. That asymmetry is what makes dimensionality reduction and feature selection non-optional in wide feature spaces, and it is the reason a model that ignores irrelevant directions outperforms one that averages over them.

  • Does that argument apply to models other than k-NN?
    It applies to any method that estimates from a local neighbourhood: kernel smoothers, histogram-style density estimates, and trees grown deep enough to isolate tiny regions. Models that impose a strong global form, such as a linear model with a handful of coefficients, escape it because they pool the whole dataset to fit few parameters rather than needing points near every query.
  • Why does most of a high-dimensional cube's volume sit near its boundary?
    The fraction of a unit cube within 0.1 of an edge along at least one axis is `1 - 0.8^d`: roughly 36 percent in two dimensions, 89 percent in ten, and effectively everything by fifty. Each added axis is another chance to be near a face, so typical points are boundary points, and predicting for them is extrapolation rather than interpolation.
  • Does the answer change if the ten features are strongly correlated?
    Yes, substantially. Correlated features do not fill their own cells independently, so the data occupies far fewer effective directions than the column count suggests. The exponent that governs the requirement is the intrinsic dimension, not the number of columns, which is why ten near-duplicate features cost far less data than ten independent ones.

One extra feature is not one more shelf in the library, it is another whole floor — each feature multiplies the space instead of adding to it.

saying these in an interview costs you the question

  • Answers five times more, because ten is five times two
  • Thinks the requirement grows linearly with the feature count
  • Believes the exponential need can be met by collecting more data
  • Ignores that correlated features share the same effective directions

context