Expand description
Principal Component Analysis (ISL ch 12, PRML ch 12) — the eigendecomposition
of the feature covariance, reusing linear_algebra::{gemm, eigen} (no new
solver). Mission note: PCA is the principled way to choose the engine’s 10D→5D
NQuin relevance projection.
Centre the data, form the p×p covariance C = Xcᵀ Xc /(n−1) with gemm,
symmetric-eigendecompose it with symmetric_eigen, and sort the eigenpairs
descending. Eigenvalue k is the variance along principal component k.
Kernel-class DenseLinear (covariance GEMM), dispatch-ready.
Structs§
- Pca
- A fitted PCA.
componentsholds the principal axes as rows (n_components × p), ordered by descending explained variance;explained_variance[k]is the variance (eigenvalue) along componentk.
Functions§
- fit
- Fit PCA to a row-major
n × pmatrix.None-equivalent failures are returned asLearningError(fail closed):InvalidDimension,InsufficientData(n < 2), orSingularif the eigensolver cannot decompose the covariance.