CLASSICAL ML · INTERVIEW QUESTION
Explain Gaussian Mixture Models (GMM). How do they differ from K-Means?
🔴 advanced · Unsupervised Learning
Hint: Think about soft vs hard assignment, and the EM algorithm.
Answer
GMMs model data as a mixture of K Gaussian distributions: p(x) = Σπ_k N(x|μ_k, Σ_k) where π_k are mixing weights. Differences from K-Means:
-
Soft assignment: GMM gives probability of belonging to each cluster, K-Means assigns hard labels.
-
Cluster shape: GMM allows elliptical clusters (via covariance Σ_k), K-Means assumes spherical.
Training: GMM uses Expectation-Maximization (EM): E-step computes responsibilities (soft assignments), M-step updates parameters. K-Means is a special case of GMM with fixed identity covariance and hard assignment.
- GMM provides a density estimate, K-Means doesn't.
Limitations: sensitive to initialization, can converge to local optima, struggles in high dimensions. Model selection: use BIC to choose K.
Related questions
- Compare K-Means, DBSCAN, and hierarchical clustering. When would you use each?
- What is cluster analysis and what are its main applications?
- How do you determine the optimal number of clusters?
- What is overfitting? How do you detect and prevent it?
- Explain the difference between bagging and boosting. When would you use each?