ML model visualizer

K-Means Clustering

Group points by repeatedly assigning them to the nearest centroid and updating cluster centers.

TypeUnsupervisedTaskClusteringDistanceEuclideanOutputCluster IDs
Clusters (K)
3

Cluster Space

-8-6-4-202468-8-6-4-202468Feature 1Feature 2
CentroidPrevious position
1
Ready to initializeInitialize centroids to begin clustering.
Iteration0Reassigned0Shift0.000

How K-Means Works

  1. 1
    Initialize centroidsChoose K initial center positions.
  2. 2
    Assign nearest clusterMatch each point to its closest centroid.
  3. 3
    Recalculate centroidsMove each center to its cluster mean.
  4. 4
    Repeat until stableStop when centroid movement is negligible.

K-Means Explained

  1. Initialize K centroid positions
  2. Assign every point to its nearest centroid
  3. Recalculate each centroid as the cluster mean
  4. Repeat assignment and update steps
  5. Stop when the centroids no longer move

Clustering Metrics

Inertia (WCSS)0.00Points Reassigned0Centroid Shift0.000

Cluster Summary

Initialize centroids to see cluster statistics.