PCA Playground

EEC 351 · Fundamentals of AI/ML · Prof. Parikshit Pareek & Prof. Jitin Singla · IIT Roorkee

Click on the plot to add data points. The principal components are computed live as eigenvectors of the sample covariance matrix C = (1/n) X⊤X. Try the preset datasets to see different shapes, and toggle the projection / reconstruction to see what PCA loses when we keep only PC1.

Preset:
raw data centered data PC1 PC2 projection onto PC1
Click anywhere in the plot to add a point. Click an existing point to remove it.

Display options

Mean & Covariance Matrix

n = 0 points
x̄ = —
C = (1/n) X⊤X =

Eigendecomposition of C

λ1 = —,   v1 = —
λ2 = —,   v2 = —
Total variance: tr(C) = —

Variance Explained

EVR(1) = —
EVR(2) = —

What to notice during class