Experiments / live
PCA playground
A cloud of data has natural axes: perpendicular directions, ranked by how much the points spread along each. This playground scatters a 2-D point cloud, forms the 2×2 covariance matrix, and computes its two eigenvectors analytically — the principal components. The steel arrow PC1 points along the direction of greatest variance (the long axis of the cloud); the gold arrow PC2 is perpendicular to it, along the smaller spread — each drawn through the centroid at two standard deviations 2√λ for visibility. Hit Regenerate to reshape the cloud and watch the axes swing to follow. Hit Project onto PC1 and the second dimension collapses: every point drops onto the PC1 line — dimensionality reduction, the best one-dimensional shadow the cloud can cast, with the gold drop-lines showing the reconstruction error. The readout gives the explained variance λᵢ/Σλ carried by each axis. The full derivation is in the essay.
a point cloud and its principal axes