Expand description
Principal Component Analysis using covariance matrices.
use rustframe::compute::models::pca::PCA;
use rustframe::matrix::Matrix;
let data = Matrix::from_rows_vec(vec![1.0, 1.0, 2.0, 2.0], 2, 2);
let pca = PCA::fit(&data, 1, 0);
let projected = pca.transform(&data);
assert_eq!(projected.cols(), 1);
Structs§
- PCA
- Returns the
n_components
principal axes (rows) and the centred data’s mean.