Curse of Dimensionality illustration

Curse of Dimensionality

Intuition from two or three dimensions fails badly in high-dimensional space. Sample 500 points uniformly in the unit hypercube and drag the dimension slider from 1 to 500: the histogram of pairwise distances morphs live, concentrating into an ever-narrower band around its mean (toggle the √d normalization to see the shape freeze). Readouts track the collapse: the farthest-to-nearest neighbor distance ratio slides toward 1, the fraction of volume inside a 90%-side inner cube shrinks toward zero — everything migrates to the shell — and the center ball empties. A second panel delivers the practical punchline: k-NN accuracy on two classes separated in only 2 informative dimensions decays steadily as noise dimensions are added, because the signal drowns in the distance computation.

Runs 100% in your browser — models are trained and computed locally on your device.

Notes

  • Pairwise distances in the unit cube have mean ≈ √(d/6) and bounded variance, so the relative spread shrinks like 1/√d — concentration of measure.
  • A cube with sides at 90% of the unit cube keeps only 0.9^d of the volume: at d = 50 that is under 0.6%, so almost all volume sits in a thin shell near the boundary.
  • When the nearest and farthest neighbor are nearly equidistant, nearest-neighbor methods lose their discriminating power — high-dimensional data needs feature selection or dimensionality reduction first.
  • Runs 100% in your browser — models are trained and computed locally on your device.