The Curse of Dimensionality: When Your "Nearest" Neighbor Is Far Away
Suppose you have training points drawn uniformly from the -dimensional unit hypercube , and you want to use the 1-nearest-neighbor rule to predict at the center point .
To "capture" a fraction of the data (i.e., the expected fraction of training points within a hypercubic neighborhood of ), you need a neighborhood of edge length where , so .
Question: For (capturing 1% of the data), compute for . What happens as ?
Then explain: why does this imply that 1-nearest-neighbor in high dimensions is essentially a global method, not a local one?
Finally, consider the expected prediction error (EPE) of 1-NN relative to OLS when the true model is linear: . The EPE ratio starts at approximately in low dimensions. Give an intuitive explanation for why this ratio is at least 2 even in .
Answer: Curse of Dimensionality: Nearest Neighbor Becomes Global
Key Idea / Intuition
In low dimensions, "nearby" means genuinely local. But in high dimensions, to find even a tiny fraction of your data, you must look almost everywhere in the cube โ the neighborhood that captures 1% of the data has edge length close to 1. This is the geometric heart of the curse of dimensionality: local methods become global, losing their ability to exploit local structure. The EPE ratio of 2 arises because 1-NN has irreducible variance equal to (from the label noise of the nearest neighbor itself), whereas OLS (under a correct linear model) has near-zero variance, so the 1-NN error is at least , giving a ratio against OLS's EPE .
Formal Proof / Solution
Part 1: Edge Length Computation
To capture fraction of uniformly distributed points, the hypercubic neighborhood of edge length satisfies:
For :
| | | Interpretation | |-----|----------------------|----------------| | | | 1% of the unit interval โ truly local | | | | 10% of each side โ already a large square | | | | 63% of each side! |
As :
No matter how small is, the required edge length as .
Part 2: Why 1-NN Becomes Global
A neighborhood capturing only 1% of the data already spans 63% of each coordinate axis in dimensions. The "nearest neighbor" is no longer near โ it could be almost anywhere in the cube. The implicit smoothness assumption ("nearby points have similar labels") completely breaks down. The method is forced to interpolate across the entire feature space, making it no more "local" than a global method.
Part 3: EPE Ratio โฅ 2 Even at
For the model with , the EPE of any predictor decomposes as:
For OLS (correct linear model): bias , variance for large , so:
For 1-NN: The prediction is , where is the nearest training point. There are two sources of noise:
- Noise in the label: โ irreducible, contributes
- Distance bias: because โ contributes additional error
Thus:
The ratio is:
But more precisely, even in with points uniform on , the expected distance to the nearest neighbor is , giving a nonzero bias term. For the linear , the distance contribution is small but positive, and the variance alone is already . Since 1-NN uses a single noisy observation (variance ) while OLS averages over points (variance ), we get:
The key insight: 1-NN's irreducible variance (from the training label noise) is an extra cost OLS doesn't pay, because OLS borrows strength from all observations, while 1-NN only uses one.
As increases, the bias term grows (nearest neighbor drifts away), so the ratio exceeds 2 and keeps growing โ exactly as shown in Figure 2.9 of ESL.
Source: The Elements of Statistical Learning, Hastie, Tibshirani, Friedman (2nd ed.), Section 2.5, Figure 2.9