How can the k-means objective be written as a trace problem over cluster indicator vectors, and what lower bound on the optimal SSE do you get by relaxing it to orthonormal matrices when the data are centred?
Unsupervised learning, k-means theory
Level L5 Expert. Length Long. Nature Mat Mathematical.
What's being asked
Whether you can rewrite SSE with normalised indicator vectors, relax the discrete constraint, and connect the result to PCA.
Key idea
For (rows are points) and normalised indicators , forming with , we have . Minimising SSE is maximising with .
Steps
- For a cluster, , because the cross term sums to and the last term adds .
- Write .
- Sum over clusters: . In the discrete problem each row of (one point) has exactly one nonzero entry, in the column of its cluster.
- Relax: drop the discreteness and allow any with . By the Ky Fan theorem, is the sum of the top eigenvalues of , attained by the top eigenvectors.
- Use centring: if is centred, then . Every genuine has , so its column space contains , which contributes 0 to the trace. Hence , where are the eigenvalues of .
- Therefore , the variance left in the discarded directions of a -dimensional PCA. Example: if the eigenvalues of are and and , then .
- So the cluster indicators lie near the top principal subspace, which is why k-means is often run after PCA, and the relaxation is the same idea as in spectral clustering.
Common mistakes
- Forgetting the normalisation . Without it, and the trace form is wrong.
- Claiming the relaxed solution is the k-means solution. It is only a lower bound, and a rounding step (such as k-means on the rows) is needed.
- Using rather than components in the bound for centred data.
How long your answer should be
One page; 8–10 minutes.
Last checked on 4 December 2026.
Read this
Previous in Unsupervised learning: For symmetric t-SNE with high-dimensional affinities (symmetric, with ) and low-dimensional affinities , how do you derive for ? What do the two terms mean, and why does the Student-t kernel help with the crowding problem?
Next in Unsupervised learning: For a similarity graph with weights , degrees and Laplacian , how do you derive the relaxation of the two-way normalised cut into the generalised eigenproblem ? How do you check the bound on the graph with , ?