[Paper Review] k-Means Clustering Is Matrix Factorization
This paper establishes that conventional k-means clustering is mathematically equivalent to a low-rank matrix factorization problem, where the k-means objective function is shown to be equal to the Frobenius norm of the difference between the data matrix X and its low-rank approximation XZ^T(ZZ^T)^{-1}Z. The key contribution is a rigorous derivation proving that k-means minimization is equivalent to constrained matrix factorization with binary assignment indicators and centroid constraints.
We show that the objective function of conventional k-means clustering can be expressed as the Frobenius norm of the difference of a data matrix and a low rank approximation of that data matrix. In short, we show that k-means clustering is a matrix factorization problem. These notes are meant as a reference and intended to provide a guided tour towards a result that is often mentioned but seldom made explicit in the literature.
Motivation & Objective
- To formally establish the equivalence between k-means clustering and matrix factorization, a relationship often cited but rarely derived in detail.
- To clarify the mathematical underpinnings of k-means by expressing its objective function in matrix form.
- To demonstrate that the k-means objective can be rewritten as the squared Frobenius norm of a matrix difference involving data and cluster assignments.
- To show that the optimal cluster centroids in k-means correspond exactly to the solution of a matrix factorization problem with binary indicator constraints.
- To provide a self-contained, step-by-step derivation that makes the matrix factorization interpretation of k-means explicit and accessible for researchers and students.
Proposed method
- The paper expresses the k-means objective function as a sum over data points and clusters: ∑ᵢ∑ⱼ zᵢⱼ‖xⱼ − μᵢ‖².
- It rewrites this sum as the squared Frobenius norm ‖X − MZ‖², where X is the data matrix, M is the centroid matrix, and Z is the binary assignment matrix.
- It proves the equivalence of the k-means objective to the matrix factorization form by expanding both sides and using trace identities and properties of the indicator matrix Z.
- It derives the closed-form solution for the centroids μᵢ as μᵢ = (1/nᵢ)∑ₓⱼ∈Cᵢ xⱼ, showing that M = XZ^T(ZZ^T)^{-1} is the optimal factorization matrix.
- It leverages the cyclic invariance of the trace and the diagonal structure of ZZ^T to equate the trace terms in the expansion.
- It confirms that the solution for M corresponds to the cluster means, thus validating the matrix factorization interpretation.
Experimental results
Research questions
- RQ1Can the k-means clustering objective function be expressed as a matrix factorization problem using standard matrix norms?
- RQ2What is the precise mathematical relationship between the k-means objective and the Frobenius norm of a matrix difference?
- RQ3How does the binary indicator matrix Z enforce cluster assignments in the matrix factorization framework?
- RQ4What is the closed-form solution for the centroid matrix M in terms of X and Z, and how does it relate to cluster means?
- RQ5Does the matrix factorization formulation of k-means recover the standard k-means algorithm when solved optimally?
Key findings
- The k-means objective function is mathematically equivalent to the squared Frobenius norm ‖X − MZ‖², where M contains the cluster centroids and Z is the binary assignment matrix.
- The objective function can be rewritten as ‖X − XZ^T(ZZ^T)^{-1}Z‖², showing that k-means is a constrained low-rank matrix factorization.
- The optimal centroid matrix M is given by M = XZ^T(ZZ^T)^{-1}, which corresponds exactly to the mean of each cluster.
- The derivation confirms that the trace terms in the expansion of the Frobenius norm match term-by-term with the standard k-means objective function.
- The matrix factorization formulation reveals that k-means minimization is equivalent to projecting data onto a low-rank subspace spanned by cluster centroids under binary assignment constraints.
- The result provides a formal algebraic foundation for understanding k-means as a form of matrix approximation, unifying clustering and low-rank decomposition.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.