Not understanding how k-means clustering or Lloyd's Algorithm Updates

104 Views Asked by At

I’m not understanding how k-means clustering updates. At time t=0, all samples are grouped to the random initialization centroids. Next the means of all samples pertaining to each centroid is calculated, and each centroid is moved to its (new) mean location. I’m not understanding why that (new) mean location would be different than the original position for a continuous space. Particularly, I'm looking at Assignment Step and Update Step here: https://en.wikipedia.org/wiki/K-means_clustering

1

There are 1 best solutions below

0
On

This image (from here) gives an animation that hopefully makes this clearer:

k-means animation

After the centroids are moved (the stars moving), the Voronoi diagram is recomputed, changing which centroid the sample points are associated with. In this image, that is seen as the recoloring of the circles (which happens in between moving the starts/centroids).