Hub

k-Means Clustering

Step 0
Next: assign

Press Step to see the first move.

Load dots
Elbow chart: spread for k = 1 to 8

Look for the elbow: the k where adding more groups stops helping much.

How to play

  1. Tap or drag to drop dots, or load a set.
  2. Press Step to watch the two moves one at a time, or Play to run to the end.
  3. Change k, then check the elbow chart: which k fits best?
Do thisPhoneKeyboard
Drop dotsTap or dragArrows move, Space drops (on the field)
One moveStepS
Run to the endPlayP
New random startNew startR
Fewer / more groupsk slider- / +
ClearClearX

What's happening?

  • Nobody tells the computer what the groups are. It finds them by itself. That's unsupervised learning.
  • It drops k centres (the big markers) at random spots.
  • Move 1, assign: every dot joins its nearest centre and takes its colour.
  • Move 2, update: every centre jumps to the middle of its dots. The trail shows where it went.
  • Repeat until nobody switches. The spread (how far dots are from their centres) can only shrink.

Try this: load Uneven sizes with k = 3 and press Play. Did it find the two small groups? Press New start a few times. Does it always get the same answer?