k-means alternates between assigning points to centroids and updating those centroids. This opening lesson fixes the points and the two starting centroids before any assignment is revealed.

highlighted = computed this step

The shown starting state

The six points are fixed, and the starting centroids are c1=(1, 1) and c2=(7, 7).

c1=(1,1),c2=(7,7)c_1=(1, 1),\quad c_2=(7, 7)
Initial centroidsPoints and starting centroids only.initial centroid setupold c1=(1,1)old c2=(7,7)squares are the initial centroids; update is hidden in this setup view

Assign, then update

This surface shows the two mechanical moves of k-means: assign each point to a nearest centroid, then update each centroid to the mean of its assigned points.

assignupdate\text{assign}\rightarrow\text{update}
Initial centroidsPoints and starting centroids only.initial centroid setupold c1=(1,1)old c2=(7,7)squares are the initial centroids; update is hidden in this setup view

Summary

Only the setup is visible here. The next step computes distances from the displayed centroids.

setup fixed before assignment\text{setup fixed before assignment}
Initial centroidsPoints and starting centroids only.initial centroid setupold c1=(1,1)old c2=(7,7)squares are the initial centroids; update is hidden in this setup view