k-nearest neighbours (k-NN) classification: an idea from machine learning

Computer ScienceData, AI & Machine LearningAges 17–18

Loading…

Share Report a problem

The training data is two classes of points on a plane defined by two features. Students drag a new point (the star) to any position: the computer finds its k nearest neighbours, counts each class's votes and labels the new point; the shaded background shows the model's decision boundary. Add training points by clicking, and change k to see the model become sharper or smoother.