k-Means Visualizer
Clustering is a loop, not an oracle: assign every point to its nearest center, move each center to its mean, repeat.
Tip: step Assign → Update by hand once, then run the piled start and compare endings.
Try this
- Walk one loop. From the spread start with k = 3: press Assign, read the colors, press Update, watch the centers jump to their means. Two presses, one visible idea.
- Pile them up. Reset to the piled start and run to the end. Same data — do the trails lead somewhere different? The empty-cluster note may make an appearance.
- Starve a center. With k = 4, drag one center far from every point and assign. It wins no members and parks in place — the lab says so instead of dividing by zero.
How to read the loop
Lloyd's iteration has two moves. Assign: every point joins its nearest center (ties break to the lowest index, so this lab is fully deterministic). Update: each center moves to the mean of its members. The loop stops when no center moves — each one already sits exactly on its cluster's average.
The honest catch: where you start shapes where you land. Different initial centers can converge to different splits of the same data, and k-means never tells you which (if any) is “true” — it minimizes within-cluster spread, nothing more. The trails show every center's journey so the dependence is visible, not philosophical.
Clustering makes sense once you have placed the centers
This visualizer is one small piece of how ManySpace teaches machine learning — every idea as something you can seed, step, and restart.