SESK: Stuff Everyone Should Know · sesk.info/ai-knn-majority-vote
How does k-nearest neighbors classify a new point?
A majority vote of its k closest training examples.
- A majority vote of its closest training points ✔
- It follows a tree of yes/no questions
- It averages all the weights of a network
Why: k-NN does not build a model. It stores the training data, finds the k points nearest the new one, and gives it the class most of those neighbors have.
Huh, didn't know that: scikit-learn calls neighbors methods "non-generalizing" because they simply remember all their training data.
k-nearest neighbors is how I pick a restaurant. I ask the three closest people and go with the majority.
Like this card?
References
Answer: A majority vote of its closest training points. k-NN does not build a model. It stores the training data, finds the k points nearest the new one, and gives it the class most of those neighbors have.
- scikit-learn User Guide: Nearest Neighbors scikit-learn.org/stable/modules/neighbors.html
Classification is computed from a simple majority vote of the nearest neighbors of each point
Checked 2026-10-10.
Think this answer is wrong? Tap "Challenge this answer" on the card in the game and tell us why.
More stuff everyone should know
That's stuff everyone should know.