kNN & the curse of dimensionality
Step 10 of 21 in Machine Learning · Theorem · Medium
kNN predicts by majority vote of nearby points. In high dimensions all points become nearly equally far apart, so 'nearest' stops meaning anything.
Build it
kNN + distance collapse
Vectorized kNN on Iris with k chosen by CV; then plot max/min distance ratio of random points as dimensions grow from 2 to 1000.
Done when: Ratio approaches 1 as dimension grows.
Resources
- Wikipedia: Curse of dimensionality Article
- ISLR / ISLP (free book) Book
- StatQuest Video
- scikit-learn: model evaluation Article
Earn this star
On the map, you log what you built. Finish the step and its star lights.
Open this step on the map