Principal Component Analysis (PCA) is a fundamental dimensionality reduction technique that identifies the directions of maximum variance in your data. This interactive demo visualizes how PCA discovers these principal directions in 2D space.
Watch as PCA behaves like a smart compass, automatically aligning PC1 and PC2 with the data's natural spread regardless of correlation, noise, or position. The projections show how each point maps onto the principal component axes.
PCA works by computing the eigenvectors and eigenvalues of the data covariance matrix. The eigenvector with the largest eigenvalue becomes PC1, capturing the direction of maximum variance. The second eigenvector (orthogonal to the first) becomes PC2.
The covariance matrix structure:
In 2D, PC1 + PC2 always accounts for 100% of the variance. The variance explained by each component tells you how much information is retained when projecting onto that axis. High correlation creates elongated clouds where PC1 captures most of the variance.
Hover over any point to see its position in the original space and its projections onto PC1 and PC2 simultaneously.
Controls:
Buttons:
Interactive highlighting: Hover over any point in the scatter plot or projection plots to see corresponding highlights across all views.
PC arrows originate at the data mean; lengths reflect variance captured.
PC1 captures 56.6% of the variance; PC2 accounts for the remaining 43.4%.
| x | y | |
|---|---|---|
| x | 1.12 | -0.12 |
| y | -0.12 | 0.99 |
Use the controls in the sequence suggested in the classroom flow tab, or freestyle to answer “what if” questions from the cohort.