MiniBatchSparsePCA<T>
Models & Types · AiDotNet.Preprocessing.DimensionalityReduction
Mini-batch Sparse PCA using online dictionary learning.
Inheritance: TransformerBase<T, Matrix<T>, Matrix<T>> → MiniBatchSparsePCA<T>
For Beginners
Think of this as SparsePCA on a budget:
- SparsePCA looks at ALL your data at once (memory intensive)
- MiniBatchSparsePCA looks at small pieces at a time (memory efficient)
- Results are similar, but mini-batch is faster for large datasets
- Trade-off: Slightly less accurate but much more scalable
How It Works
MiniBatchSparsePCA is a faster, memory-efficient version of SparsePCA that processes data in mini-batches instead of using the full dataset. This makes it suitable for large datasets that don’t fit in memory.
The algorithm uses online dictionary learning with mini-batches, updating the components incrementally as it processes each batch.
Constructors
| Constructor | Summary |
|---|---|
MiniBatchSparsePCA(int nComponents, double alpha, double ridge, int batchSize, int nIter, double tol, bool shuffle, int? randomState, int[] columnIndices) |
Creates a new instance of MiniBatchSparsePCA. |
Properties
| Property | Summary |
|---|---|
Matrix<T> Components { get; } |
Gets the sparse components (each row is a component). |
Vector<T> Mean { get; } |
Gets the mean of each feature. |
bool SupportsInverseTransform { get; } |
Gets whether this transformer supports inverse transformation. |
double Alpha { get; } |
Gets the sparsity regularization parameter. |
double Ridge { get; } |
Gets the ridge regularization parameter. |
int BatchSize { get; } |
Gets the batch size. |
int NComponents { get; } |
Gets the number of components. |
int NSamplesSeen { get; } |
Gets the number of samples seen during fitting. |
Methods
| Method | Summary |
|---|---|
string[] GetFeatureNamesOut(string[] inputFeatureNames) |
Gets the output feature names after transformation. |