All demos

KNN Algorithm Walkthrough

KNN activity

Follow one KNN prediction from start to finish

This walkthrough slows K-nearest neighbors into its four decisions: measure every distance, sort the points, select the nearest K, then vote on a label.

Try this
  1. Choose a dataset and place the sample point.
  2. Use Next to move through each algorithm step.
  3. Change K or move the point, then compare the vote.
5
Sample point
Custom
0.50
0.10
Presets

Algorithm Graph

Current Algorithm Step

Step 1 of 4
Current step

Measure distances