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
CentroidPrevious position
Ready to initializeInitialize centroids to begin clustering.
Iteration0Reassigned0Shift0.000How K-Means Works
- 1Initialize centroidsChoose K initial center positions.
- 2Assign nearest clusterMatch each point to its closest centroid.
- 3Recalculate centroidsMove each center to its cluster mean.
- 4Repeat until stableStop when centroid movement is negligible.
Initialize K centroid positionsAssign every point to its nearest centroidRecalculate each centroid as the cluster meanRepeat assignment and update stepsStop when the centroids no longer move
Clustering Metrics
Inertia (WCSS)0.00Points Reassigned0Centroid Shift0.000
Cluster Summary
Initialize centroids to see cluster statistics.