Expand description
Decomposition and embedding algorithms and their shared linear algebra.
Each concrete algorithm lives in its own submodule (pca, factor_analysis,
ica, tsne, umap, lle) and is re-exported here so callers name
decomposition::<algo> without the submodule path. This module owns the dense
linear-algebra primitives the family shares — mean-centering, the covariance
matrix, a symmetric-eigenvalue Jacobi solver, and a reconstruction-error
measure — operating on row-major f64 buffers.
Components and embedding axes are defined only up to sign (and, for ICA and spectral methods, up to ordering), so the equivalence suite compares the sign/order-invariant quantities — explained variance, reconstruction error, and trustworthiness — rather than raw component values.
Structs§
- Factor
Result - Outcome of a factor-analysis fit.
- IcaResult
- Outcome of a
FastICAfit. - PcaResult
- Outcome of a PCA fit.
Functions§
- at
- Reads entry
(i, j)from a row-majorn×nbuffer (0.0if out of range). - column_
means - Computes the per-feature mean (centroid) of a row-major data matrix.
- count_
to_ f64 - Widens a
usizecount tof64without anascast. - covariance
- Computes the
dim×dimsample covariance matrix ofcentered(already mean-centered) using the unbiasedn − 1denominator, matchingscikit-learn. - descending_
order - Returns the eigenvalue indices in descending order of eigenvalue.
- factor_
analysis - Fits a
k-factor model todataby SVD-based EM. - fast_
ica - Separates the linear mixture
mixedinton_componentsindependent sources. - identity
- Builds the
n×nidentity matrix in a row-major buffer. - jacobi_
eigen - Computes the eigenvalues and eigenvectors of a symmetric
n×nmatrix by the cyclic Jacobi rotation method. - lle
- Embeds
datainton_componentsdimensions by locally linear embedding. - mean_
center - Mean-centers
data, returning the centered matrix and the column means. - pca
- Fits PCA to
data, returning the topn_componentsprincipal components. - put
- Writes entry
(i, j)into a row-majorn×nbuffer (no-op if out of range). - reconstruction_
error - Computes the mean squared reconstruction error between two equal-shaped matrices.
- symmetric_
inverse - Inverts a small symmetric positive-definite
n×nmatrix via its eigen- decomposition:A⁻¹ = V diag(1/λ) Vᵀ. - tsne
- Embeds
datainton_componentsdimensions by t-SNE. - umap
- Embeds
datainton_componentsdimensions by a UMAP-style layout.