Skip to main content

Module pca

Module pca 

Source
Expand description

PCA initialisation via faer SVD on the d×d covariance matrix.

This approach costs O(n·d²) rather than O(n²) — at n=10M and d=46, the covariance matrix is 46×46 = 2116 f32 elements, trivially small.

Functions§

pca_init
Project n × d row-major data onto its top 2 principal components.