ML model visualizer
K-Nearest Neighbors
Explore how nearby examples drive classification and regression predictions.
TaskClassificationLearningLazy LearningDistanceEuclideanOutputClass Label
115
Decision Space
Class AClass BQuery pointNearest neighbor
PredictionReadyChoose a query point and inspect its 5 nearest neighbors.
Metrics
Classes / points2 / 24
Neighbors found0
ConfidencePending
Nearest Neighbors
| Rank | Class | Distance |
|---|---|---|
| Run prediction to inspect neighbors. | ||
Measure distance from the query to every training pointSort all points by increasing distanceSelect the K nearest neighborsCount the class labels among those neighborsReturn the class with the most votes