ailiteracynepal 🇳🇵
Text size

Chapter 04 · Section II · 10 min read

The nearest neighbor method

The simplest learning algorithm in existence — and why it still works.

The nearest-neighbour classifier does almost no work. To predict the label of a new point, it looks up the closest example it has seen before, and copies that label.

That is the entire algorithm. No training. No optimisation. No parameters. And it works, in many cases, very well — well enough that it is a sensible first thing to try on any classification problem before reaching for anything fancier.

This section is a stub. The full version will run through a worked example classifying Newari restaurant reviews by sentiment.