Pick k centroids, assign each point to the nearest one, recompute each centroid as the mean of its points, and repeat until assignments stop changing.
It minimizes within-cluster variance, assumes roughly spherical clusters of similar size, is sensitive to scaling, outliers and initialization (use k-means++ and several restarts).
Choose k with the elbow method (inertia vs k), silhouette score, or domain knowledge.
Loading…