The Blessing of Dimensions: When Does the Nearest Neighbor Lie?
You have training points drawn i.i.d. uniformly from the -dimensional unit hypercube , and you want to predict at the origin .
The 1-nearest neighbor classifier uses the single closest training point to make its prediction.
To "capture" a fraction of the data (i.e., so that the expected number of training points within a ball of radius around the origin is ), the required edge length of a sub-cube satisfies:
The puzzle: Suppose you want to use the nearest of the data to make a local estimate. Compute for and explain what this reveals about nearest-neighbor methods in high dimensions. What is the conceptual implication for the bias of 1-NN?
Note: Use throughout.
Answer: Curse of Dimensionality: Nearest Neighbor Bias
Key Idea / Intuition
In low dimensions, "local" truly means local โ you can find nearby neighbors in a small region. But as dimension grows, the volume of a hypercube scales as , so to contain any fixed fraction of points, you must reach out to a large neighborhood. The curse of dimensionality means that "nearest neighbors" are not really near at all, and local methods silently become global โ introducing massive bias without anyone noticing.
Formal Proof / Solution
Setup
To capture a fraction of uniformly distributed points in , we need a sub-cube with side length satisfying:
This is because the volume of a -dimensional sub-cube of side is , and the fraction of uniform points it contains is exactly .
Computation
Set :
| Dimension | Required side length | |:---:|:---:| | | | | | | | | |
What This Reveals
-
In : to capture 1% of the data, you only need to reach out of the way across the space. Truly local.
-
In : you must reach out of the way. Still manageable.
-
In : you must reach of the way across the entire input space just to find 1% of the data. Your "local" neighborhood is most of the space.
Implication for Bias
The 1-NN classifier predicts using the label of the single nearest training point. Its bias comes from the fact that the nearest neighbor is not at the query point itself โ it lies at some distance away. The prediction is:
In low dimensions is small, so the bias is small. In high dimensions, the nearest neighbor can be far from the query point โ even with a large dataset. The bias of 1-NN does not vanish as for fixed , because the neighbor is essentially drawn from across the whole space.
The Paradox
This is subtle: we have training points, yet every one of them is far from the query. The data is not "sparse" in the sense of being few โ it's sparse because high-dimensional volume is overwhelmingly concentrated away from any fixed point. Local neighborhoods must be global to contain anything.
Summary punchline: The formula makes the curse of dimensionality completely explicit and quantitative. With and , you need โ more than half the input range โ just to find 1% of your data.
Source: The Elements of Statistical Learning, Hastie, Tibshirani, Friedman, 2nd ed., Section 2.5