1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//! # Principal Component Analysis (PCA)
//!
//! This module provides Principal Component Analysis implementations for sparse matrices.
//! PCA is a dimensionality reduction technique that finds the principal components
//! (directions of maximum variance) in high-dimensional data.
//!
//! ## Available Implementations
//!
//! - [`SparsePCA`] - Standard PCA for sparse CSR matrices
//! - [`MaskedSparsePCA`] - PCA with feature masking for selective analysis
//!
//! ## SVD Methods
//!
//! Two SVD algorithms are supported via [`SVDMethod`]:
//! - **Lanczos**: Deterministic iterative method, good for general use
//! - **Randomized**: Faster approximation method with configurable parameters
//!
//! ## Key Features
//!
//! - **Sparse matrix support**: Efficient handling of sparse CSR matrices
//! - **Optional centering**: Data can be centered or used as-is
//! - **Explained variance**: Calculate variance ratios and cumulative variance
//! - **Feature masking**: Selectively include/exclude features in analysis
//! - **Builder patterns**: Convenient configuration with sensible defaults
//!
//! ## Usage Pattern
//!
//! 1. Create PCA instance using builder pattern
//! 2. Fit the model to training data
//! 3. Transform data to reduced dimensions
//! 4. Analyze explained variance and feature importance
pub use SparsePCA;
pub use SparsePCABuilder;
pub use MaskedSparsePCA;
pub use MaskedSparsePCABuilder;
pub use PowerIterationNormalizer;
pub use SvdFloat;
/// SVD computation method for PCA.
///
/// Determines the algorithm used for singular value decomposition:
/// - `Lanczos`: Iterative method with guaranteed convergence
/// - `Random`: Faster randomized approximation with tunable accuracy