📈k-Nearest Neighbors (k-NN)
Also known as k-NN, KNN, Nearest Neighbor Classifier
It finds the closest cases it knows. Then it copies what most of them say.
Think of it like
Think of it like a new kid at school. You guess their team from the three kids next to them.
Example
Jack sets k to 3. A new fruit sits nearest to two apples and one pear on his chart, so his model calls it an apple.
Why it matters
It is simple and needs no real training. The same idea of finding the nearest items helps power search and suggestions.
Definition
Common mistake
Key takeaways
- 1Find the closest. The k nearest examples.
- 2Copy the majority. Most neighbours decide.
- 3Lazy learner. Work happens at question time.