Back to Classic ML Mind Map
中文·English
📊 Classic MLID: gmm-em

GMM Soft Assignment

GMM 软分配
🎯Core Definition
A Gaussian mixture model (GMM) models the data distribution as a weighted sum of KK Gaussian components, p(x)=k=1KπkN(xμk,Σk)p(x) = \sum_{k=1}^{K} \pi_k \mathcal{N}(x \mid \mu_k, \Sigma_k), with mixing coefficients satisfying kπk=1, πk0\sum_k \pi_k = 1, \ \pi_k \ge 0.Parameters are estimated with EM: the E-step computes responsibilities (posteriors, i.e. soft assignments) γik=πkN(xiμk,Σk)j=1KπjN(xiμj,Σj)\gamma_{ik} = \frac{\pi_k \mathcal{N}(x_i \mid \mu_k, \Sigma_k)}{\sum_{j=1}^{K} \pi_j \mathcal{N}(x_i \mid \mu_j, \Sigma_j)}; the M-step re-estimates Nk=iγikN_k = \sum_i \gamma_{ik}, πk=NkN\pi_k = \tfrac{N_k}{N}, μk=1Nkiγikxi\mu_k = \tfrac{1}{N_k} \sum_i \gamma_{ik} x_i, and Σk=1Nkiγik(xiμk)(xiμk)T\Sigma_k = \tfrac{1}{N_k} \sum_i \gamma_{ik} (x_i - \mu_k)(x_i - \mu_k)^T.As Σk=σ2I\Sigma_k = \sigma^2 I with σ0\sigma \to 0, responsibilities collapse to hard 0/1 assignments and the EM update reduces to cluster means — K-Means is exactly the zero-variance EM special case of GMM.
💡Use Cases
soft clustering and density estimation, anomaly detection (low-likelihood samples), speaker recognition, background modeling, and as an upgrade when K-Means underperforms; interviews ask for the responsibility formula and the K-Means-as-GMM derivation.
Key Problems Solved
K-Means only produces hard clusters and assumes spherical shapes; GMM outputs a posterior probability for every sample (confidence and uncertainty), and per-component covariances fit elliptical clusters of varying scale and orientation. The cost: far more parameters — d+d(d+1)2d + \tfrac{d(d+1)}{2} covariance parameters per Gaussian — a non-convex likelihood that needs K-Means++ initialization and constrained covariances (diagonal/shared/regularized) to avoid singular degeneracy.
🎯5 High-Frequency Exam Points
1
Write the GMM density p(x)=kπkN(xμk,Σk)p(x) = \sum_k \pi_k \mathcal{N}(x \mid \mu_k, \Sigma_k) and the responsibility γik\gamma_{ik}; why does kγik=1\sum_k \gamma_{ik} = 1?
2
Why is K-Means the EM special case of GMM as Σk0\Sigma_k \to 0? How does the responsibility collapse to hard 0/1 assignment?
3
Derive the GMM M-step updates πk=NkN\pi_k = \tfrac{N_k}{N} and μk=1Nkiγikxi\mu_k = \tfrac{1}{N_k} \sum_i \gamma_{ik} x_i; why are these weighted means?
4
When do GMM and K-Means clusters differ significantly? What extra value does soft assignment bring (confidence, anomaly detection)?
5
Parameter count and overfitting risk of GMM? Why can covariances degenerate to singular solutions, and what constraints help?
📖 In-depth Guide:📄 clustering-and-knn
Updated 2026-08-12
🎯
Test Your Knowledge: Practice Questions for "GMM Soft Assignment"
Single choice pitfall questions with instant feedback and mistake tracking.
🚀 Start Card Practice
Previous CardEM AlgorithmNext CardKNN & K Selection

🔗 More Classic ML Knowledge Cards

AdaBoost DerivationBagging & Random ForestBaum-Welch (HMM EM)GBDT Negative Gradient