k-means
k-means gets points without labels and a number k. it drops k centres, then repeats two moves: assign every point to its nearest centre, and update every centre to the middle of its points. inertia, the sum of squared distances from points to their centres, can only go down, so it always stops.
try this
- press reseed and run, a few times over. the points never change, yet at seed 4 the answer does: one centre takes two groups and two centres split another.
- seed 4 stops at an inertia of 4.72, about seven times the 0.65 of the right groups. no single step makes it better, so it stays: a local optimum.
- switch the start to k-means++ and run seed 4 again. it spreads the first centres out and finds all four groups. under more, it gets stuck in 6 of 100 seeds, random starts in 33.