Loading K-Means clustering visualizer interface.
Loading K-Means clustering visualizer interface.
Interactive Learning Lab
Watch unlabeled points organize into K groups. Press Play to run the Assign → Update loop and see centroids settle into clusters.
Click the canvas to add a point, then press Play.
K-Means looks for 3 cluster centers (centroids) that minimize how far points sit from their nearest center. It repeats two steps until nothing changes:
1. Assign: color each point by its nearest centroid.
2. Update: move each centroid to the average of its points.
Inertia (WCSS) drops every iteration and flattens at convergence.
Reseed to see how the random start changes the final clusters.
They share the letter K but solve opposite problems — a classic point of confusion.
KNN — Supervised
Uses labeled data. K = how many neighbors vote to classify a new point.
K-Means — Unsupervised
Uses unlabeled data. K = how many clusters to discover in the data.