The Curse of Dimensionality: Where Does the Data Hide?
You draw points uniformly at random from the -dimensional unit hypercube .
Part (a): Show that the expected distance from a query point to its nearest neighbor grows as (for fixed ).
Part (b) [The real puzzle]: Consider instead the unit hypersphere in . Show that for large , almost all of the volume of the ball is concentrated in a thin shell near the surface. Specifically, show:
for any fixed .
Part (c) [Punchline]: What does this imply about -nearest neighbor classifiers in high dimensions?
Answer: Curse of Dimensionality: Shell Concentration
Key Idea / Intuition
The core insight is embarrassingly clean: in high dimensions, the volume of a ball scales as , so shrinking the radius even slightly collapses the volume exponentially fast. Think of it this way โ in dimensions, "most" of the ball lives near its boundary because volume is dominated by the outermost layer, just as most of the mass of a thin-shelled balloon is in the rubber, not the air inside. This geometric fact has devastating consequences for any distance-based method.
Formal Proof / Solution
Part (a): Nearest Neighbor Distance in the Hypercube
Let be the distance to the nearest neighbor. For a query point, the probability that a single point falls outside a ball of radius is roughly .
A simpler clean version: consider a -NN rule that captures fraction of the data. The side length of a hypercube containing fraction of the unit hypercube satisfies:
For , , so the required side length is:
As with fixed:
So the neighborhood needed to find even 1 neighbor expands to the entire space. Distance loses meaning.
Part (b): Volume Concentrates in a Shell
The volume of a -dimensional ball of radius is:
where is a constant depending only on .
Therefore:
Since , we have:
Therefore:
Concretely: In dimensions, with :
Over 99.4% of the ball's volume lives in the outermost 5% shell!
Part (c): Implications for -NN Classifiers
The combined picture is stark:
-
All points are far away: nearest neighbors are nearly as far as the farthest point. The notion of "close" becomes meaningless.
-
All points are equidistant: since data lives in a thin shell, the ratio of max to min distance satisfies: Sorting by distance becomes numerically unstable and semantically vacuous.
-
-NN needs exponentially more data: to maintain a fixed neighborhood fraction , you need points โ exponential in .
Practical takeaway (from ESL Chapter 2): In dimensions, to cover 1% of the data range in each direction, you need training points. This is the curse of dimensionality โ distance-based methods silently degrade as dimension grows, unless the data has low intrinsic dimension or strong structure (like smoothness or sparsity).
Source: The Elements of Statistical Learning, Hastie, Tibshirani, Friedman, 2nd ed., Chapter 2