How does k-nearest neighbors classify a new point?

A majority vote of its k closest training examples.

Start playing free

  1. A majority vote of its closest training points ✔
  2. It follows a tree of yes/no questions
  3. 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.

The dad joke
k-nearest neighbors is how I pick a restaurant. I ask the three closest people and go with the majority.
Like this card?
Play the game

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.

  1. 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.

Test yourself in the game