MPE StudioMath of Planet Earth
Machine Learning Toolkit · 03

K-Means: A Canonical Clustering Method

Alternate assignments and centroid updates

K-means partitions data into k groups by alternating between the nearest-center assignment and the centroid update.

watchone idea
→
manipulateone example
→
leave withone intuition

The essential idea: each iteration can only decrease the within-cluster squared-distance objective.

Watch the concept

One Concept · One Example

K-Means: A Canonical Clustering Method video thumbnail▶

K-Means: A Canonical Clustering Method

Presented by Charlotte Moser

Watch on YouTube ↗

What to notice

The idea in 30 seconds

One objective, two alternating steps

Assignment step

Each point takes the label of its nearest current centroid.

ci=argminj‖xi−μj‖2

Update step

Each centroid moves to the mean of the points carrying its label.

μj=1nj∑ci=jxi
Explore

Watch k-means settle

Step through assignment and update phases, or restart from a new initialization.

××
KEY TAKEAWAY

K-means turns clustering into repeated nearest-center assignment and centroid recomputation.