Index Ai Academy
Glossary · Phase 3 · Machine learning

Nearest neighbors

Also written: k-nearest neighbors, kNN, k-NN

Predicting from the most similar past examples.

Try it now

Every spot on the plane takes the majority vote of its k nearest points. Slide k from 1 up to 51.

Learn it properly

Nearest neighbors · Predict from the most similar examples. About 25 minutes.

Create a free account See what's in the lesson

Never trained an AI?

Teach a small one to write, right in your browser. It takes about 20 seconds and needs no account.

Teach it to write