k-means, step by step

Watch k-means find groups in unlabeled points by alternating assign and update steps, and see where it goes wrong.

BeginnerExplained in Finding groups: k-means

k-means, step by step

Nobody labeled these points. k-means looks for k groups by alternating two simple steps.

The centers start at randomly chosen data points. Next: assign every point to its nearest center.

3
Data
Starting centers
Center moves0
Inertia (spread within clusters)n/a

Try this

  • Step through Three blobs one half-step at a time and watch the inertia chart only ever go down.
  • Press New starting centers a few times with random starts until two centers share one blob.
  • Try Stretched and No groups to see k-means find groups that are not really there.

Try "embedding", "softmax", "overfitting", or "backpropagation".