See, with pictures and motion, how a cloud of points without name tags (correct answers) is sorted into groups automatically, and how the direction in which the cloud spreads out the most is found.
Advance k-means, which splits unlabeled data into “similar” groups, and the EM algorithm for a Gaussian mixture one step at a time, and check that the responsibilities, means, covariances, and log-likelihood change exactly as the formulas say. In the second half, use PCA (principal component analysis) to check numerically that the direction of maximum projected variance is an eigenvector of the covariance matrix, that the reconstruction error equals the sum of the discarded eigenvalues, and that principal components do not coincide with the physical component spectra.
Plant flags in the cloud of points, then repeat “Paint with nearest flag color” and “Move flags to group centers” one step at a time.
These are synthetic data for teaching purposes (150 made-up points, each a pair of measurements).
Place a stick in the cloud of points so that each point casts a shadow on it, and turn the stick to find the direction in which the shadows spread out the most.
These are synthetic data for teaching purposes (100 made-up points, each a pair of measurements).
Two-dimensional data and the components (ellipses of mean and covariance)
The marker shape shows the component with the largest responsibility, and the color depth shows the size of that responsibility (in k-means, the assigned component).
Projection onto direction u and one-dimensional reconstruction
Rotating the direction u (angle φ) changes the projected variance uTSu and the reconstruction error. Variance is defined with 1/N.
The horizontal axis is the angle φ (°) of the direction u = (cos φ, sin φ)T. The sum of the projected variance uTSu and the reconstruction error (1/N)Σ‖xn − x̂n‖2 is constant, tr S = λ1 + λ2, for every φ. The vertical lines mark the current φ (gray solid) and the angle of the first principal axis (green dash-dotted).
PCA of 60 synthetic spectra × 200 points
This is synthetic data for teaching purposes (not spectra of a real material). The eigenvalues are computed from the SVD of the centered data matrix as λi = si2/N.
Eigenvalues λi (logarithmic vertical axis). The gray band is the range where the eigenvalues of noise-only data roughly fall, σ2(√D ∓ √N)2/N (D = 200, N = 60; an approximation for large matrices).
Scores tn1, tn2 (each spectrum projected onto the first and second principal components). The marker shape is divided into three levels by the mixing ratio fn1 of component 1.
Loadings vi (vectors of length 1). The overlaid pure-component spectra are also normalized to length 1. The sign of a principal component is arbitrary, and flipping it does not change the reconstruction.
The description of this simulator (procedure, formulas, conditions, questions) is on the explanation page “Explanation of the Latent Variable Simulator”.
Back to Machine Learning — From Probability to GPT (Contents) | Text: Chapter 17, Section 17.5, Chapter 18, Section 18.2 | Equations and explanation (explanation page) | Equations are typeset with the browser’s built-in MathML (no external library).