MicrolearnENPTES

k-nearest neighbours

Lesson 9 of 20 · ML.Micro

Classify a new point by asking its closest neighbours to vote.

To classify the new point (?), find the k closest training examples and take the majority class. Here k = 5: the lines show who votes.

Check yourself

How does k-NN classify a new point?

Do it in the browser: a real machine learning tool, a short mission and instant feedback. No install.

Start this lesson — free
← Feature scalingLogistic regression →

All lessons · ML.Micro