What Are the K-Nearest Neighbors (KNN)?

1 min

KNN guesses the answer by looking at who is standing closest to you — literally, the most similar examples nearby.

Imagine it like this: You move to a new school and don't know anyone. You look around and see who is sitting next to you. If most of your immediate neighbors like basketball, you might guess that you'll like it too!

Examples:

  • Recommending a movie based on what similar viewers liked
  • Guessing the price of a house from neighboring houses just sold

So? "You look like your neighbors" — KNN uses this simple idea to make surprisingly good guesses.