Core ML Concepts · beginner · concept 18 of 176
k-Nearest Neighbors (kNN)
Classify a point by asking what its k closest neighbors are. No training at all, just distance and a vote, which makes it the clearest intuition pump in ML and a surprisingly modern one: nearest-neighbor search over embeddings is exactly how vector databases retrieve, so kNN quietly powers RAG.
Key terms
Distance metricsChoice of kLazy learningCurse of dimensionalityNearest-neighbor search
Learn these first
Where you meet it in the real world
Similarity search, recommendation fallbacks, anomaly detection, the retrieval half of RAG
Videos
▶ StatQuest: K-nearest neighbors, Clearly Explained ↗
StatQuest with Josh Starmer · YouTube
▶ 10. Introduction to Learning, Nearest Neighbors ↗
MIT OpenCourseWare · YouTube
Guides and articles
Courses, papers, and more