K-Nearest Neighbors Interactive Visualizer

Explore machine learning classification in real-time

About This Visualization

This interactive demonstration shows how the K-Nearest Neighbors (KNN) algorithm classifies data points based on proximity. Observe how different parameters affect the classification:

  • k-value: Number of neighboring points considered
  • Distance metric: How distance between points is calculated
  • Weighting: Influence of neighbors based on distance

Algorithm Behavior

Decision Boundaries

The classification changes dynamically as the query point moves, revealing implicit decision boundaries formed by the training data.

Parameter Effects

Adjust parameters to see how they impact classification sensitivity and boundary smoothness.

Real-time Updates

All calculations update in real-time, showing immediate feedback for parameter changes.