# k-Means Visualizer

Canonical: https://manyspace.aporia.systems/tools/k-means
Updated: 2026-10-13

Clustering is a loop, not an oracle: assign every point to its nearest center, move each center to its mean, repeat.

## 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.

## Related tools

- [Gradient Descent Playground](https://manyspace.aporia.systems/tools/gradient-descent)
- [Loss Function Explorer](https://manyspace.aporia.systems/tools/loss-functions)
- [Logistic Regression](https://manyspace.aporia.systems/tools/logistic-regression)
- [Forward Pass](https://manyspace.aporia.systems/tools/neural-network)
- [Backpropagation](https://manyspace.aporia.systems/tools/backpropagation)
- [Attention Visualizer](https://manyspace.aporia.systems/tools/attention)
- [Tokenization Explorer](https://manyspace.aporia.systems/tools/tokenization)
