PCA Playground

Fundamentals of AI/ML · Prof. Parikshit Pareek & Prof. Jitin Singla · IIT Roorkee
P-squared Lab logo
Integral Lab logo

Click on the plot to add data points. The principal components are computed live as eigenvectors of the sample covariance matrix C = (1/n) XX. 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
=
C = (1/n) XX =

Eigendecomposition of C

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

Variance Explained

EVR(1) =
EVR(2) =

What to notice during class