Machine Learning

K-Means Clustering Visualizer

An unsupervised learning algorithm that groups similar data points into K clusters based on their distance to centroids.

Click on the canvas to add custom data points.

📜 Algorithm State

Ready. Add points or generate random ones, then click Next Step.

📍 Centroids (Mean Positions)

💡 How it works

  1. Initialize K centroids randomly.
  2. Assignment: Each point joins the nearest centroid's cluster.
  3. Update: Centroids move to the center (mean) of their assigned points.
  4. Repeat until centroids stop moving.