Principal Component Analysis
Reveal PCA in calculation order: raw data → centering/scaling → covariance → eigenvectors → projection.
A staged two-feature PCA studio that progressively reveals the exact transformation, covariance matrix, eigenpairs, explained variance, and point projections. A point inspector connects each visual step to the actual numbers used in the formulas.
Step by step
- Start with the raw feature coordinates and locate the sample mean.
- Center every point and optionally standardize each feature.
- Build the exact 2×2 covariance matrix from transformed points.
- Solve Cv = λv and order the two orthogonal principal directions.
- Inspect how much variance PC1 and PC2 explain.
- Project a selected point and the dataset onto the principal axes.
Core formulas
Covariance matrix
C = (1/(n−1)) XᵀXAfter centering, covariance captures the directions in which features vary together.
Eigenvector equation
Cv = λvPrincipal directions are covariance eigenvectors.
Explained variance ratio
EVRᵢ = λᵢ / Σⱼ λⱼEach eigenvalue tells how much variance its principal direction explains.
When to use Principal Component Analysis
- Understanding correlated features.
- Learning dimensionality reduction before using larger datasets.
- Seeing how standardization changes PCA when feature scales differ.