Chapter 2 · Machine learning basics
Clustering (unsupervised)
Without labels, clustering groups similar examples together; k-means moves centres until groups settle.
Chapter 2 · Machine learning basics
Without labels, clustering groups similar examples together; k-means moves centres until groups settle.
Start: centres dropped on random points. Next, every point picks its nearest centre.
Grey points have no labels. The big dots are centres. Points take the colour of their nearest centre, then centres move to the middle of their points.
Nobody tells the computer which group each point belongs to. This is unsupervised learning: the model must find structure by itself.
Press Next step. The first step colours points, the next moves the centres, and so on. Dashed lines show where each centre has been.
Start: centres dropped on random points. Next, every point picks its nearest centre.
Spread is the total squared distance from points to their centres: smaller means tighter groups. A simplified teaching version with forty-five made-up points; k=3 matches how the points were drawn, so other k values show how the choice shapes the answer.
What does k-means do in its 'assign' step?
What does it do in its 'move' step?
Two runs with different random starts end differently. Why?