File Exchange

image thumbnail

3D visualization of GMM learning via the EM algorithm

version 1.9 (4.19 KB) by

The evolution of a GMM in the EM algorithm is visualized by interpolating between iterations.



View License

This is a 3D visualization of how the Expectation Maximization algorithm learns a Gaussian Mixture Model for 3-dimensional data.

--How it works--
The data is either read in or generated in general-covariance gaussian clusters. For desired values of k (number of Gaussians to fit), a movie is played showing the evolution of the GMM through the iterations of the EM algorithm. The true model is only available at each iteration (viewed as an anchor frame in a movie), so the illusion of movement of the 3D Gaussians (displayed as ellipsoids at 1 standard deviation) is given by interpolating enough "frames" in between these anchor frames.

Comments and Ratings (1)

Rehan Ahmed

Nice work Johannes. appreciated



Simplified 2D plotting option, stream-lined code


Cleaned up code, improved plotting, coloring, added full-covariance capabilities


Corrected bug in EM implementation


changed mean initialization from 'at data mean with small noise' to 'at data points chosen at random' (usually gives better clustering)


reduced overhead


updated description


color gradient added to data points to show the certainty that it belongs to the nearest Gaussian

MATLAB Release
MATLAB 7.14 (R2012a)

Download apps, toolboxes, and other File Exchange content using Add-On Explorer in MATLAB.

» Watch video

Win prizes and improve your MATLAB skills

Play today