Machine Learning & AI
Intermediate

K-Means Objective (WCSS)

Clustering minimizes the total squared distance of points to their cluster centre.

Formula

J=k=1KxCkxμk2J = \sum_{k=1}^{K}\sum_{\mathbf{x}\in C_k}\lVert \mathbf{x}-\mu_k\rVert^2

Variables

C_kCluster k
\mu_kCentroid
KNumber of clusters

Example

Lower WCSS means tighter clusters

Did You Know?

K-means alternates assigning points and moving centroids — a special case of expectation-maximization.

Share this formula