Drag the ★ · tap empty space to add a point
kNN classifies a new point by a vote among the k closest training points. There is no training step: the model is the data itself (“lazy learning”).
Small k follows every noisy point (overfitting); very large k ignores local detail (underfitting).
Act it out: put students on a grid, give each a coloured card, and let a “mystery student” ask their 3 nearest neighbours what colour they are.
Real uses: recommending films (“people near you liked…”), recognising handwritten digits.
A free coding & ai simulation for Class 9–12.