PCA of Flags

Hi all,

I have created a tutorial on Principal Components analysis based on flags:

https://observablehq.com/@stschiff/pca-of-flags

(in case you’ve seen this a couple of weeks back, I have substantially beefed it up now).

The notebook introduces the key machinery behind PCA, using Eigen-Decomposition of the sample-by-sample (in my case flag-by-flag) covariance matrix. All computation and data-loading happens in the browser, there is no precomputed data. Really nice to see how all of this linear algebra is so doable and performant in the browser. I am also making use of some interactive elements, like tooltips over the covariance matrix, and a flag-picker to compare low-rank approximation to a real flag.