ML
advanced
Gaussian Mixtures & Expectation-Maximization
ML Engineer path · lesson 31 of 80k-means hands every point to one centroid and returns only centres. A Gaussian mixture recovers each cluster's shape, orientation and weight too, assigns points softly, and — because it is probabilistic — lets BIC pick the cluster count for you. A real EM loop runs in the page.
A real EM loop
Point opacity is the responsibility of its most likely component — faint points are the ones EM is genuinely unsure about. Ellipses are drawn at two standard deviations.
3
Fitted mixture weights
0.20
0.40
0.40
True weights: 0.40 · 0.40 · 0.20 (500, 500 and 250 points)
BIC and AIC across k
Lowest BIC at k=3. Both are computed by fitting a model at every k.
EM converged in 19 iterations with a log-likelihood of -2740.4. BIC 5602, AIC 5515. Compare the fitted weights above with the true 0.40 / 0.40 / 0.20.
Expectation-Maximization
Sequence
Order one EM iteration for a Gaussian mixture.
Tap a piece, then tap where it goes — or drag it. Tap the tray to take one back.
- 1Drop a step here
- 2Drop a step here
- 3Drop a step here
- 4Drop a step here
- 5Drop a step here
5 pieces left to place
Test your knowledge
20 questions
Question 1 of 20
Score: 0
Compared with k-means, a Gaussian mixture model additionally recovers each cluster's:
Learn these first
Interview Questions
Google
Meta
Two Sigma
Spotify
Google
Amazon
Apple
Databricks
Google
Uber
Palantir
Netflix
Google
Meta
Stripe
Airbnb
References & Further Reading
Love this visualization?
Sign up to track your progress, earn achievements, use the AI assistant, and access your personal learning dashboard.
100% free • No credit card required