Projection methods
A ProjectionConfig specifies an optional dimensionality reduction step applied to the transformed feature matrix before it is passed to a model. Setting projection_type to NONE skips this step entirely.
import mllabiome as mll
mll.ProjectionConfig(
projection_type=mll.ProjectionType.PCA,
n_components=50,
)The n_components parameter determines the number of output dimensions. When set to None, the default for each method is used. The degree parameter applies only to POLYNOMIAL.
Available projection methods
| Type | Description |
|---|---|
NONE | No projection. The full transformed feature matrix is passed to the model. |
PCA | Principal component analysis. |
INCREMENTAL_PCA | Incremental PCA for datasets that do not fit in memory. |
KERNEL_PCA | Kernel PCA, enabling non-linear projections via a kernel function. |
TRUNCATED_SVD | Truncated singular value decomposition (LSA). Does not centre the data and is sparse-compatible. |
FAST_ICA | Fast independent component analysis. |
SPARSE_PCA | Sparse PCA, where components are constrained to be sparse. |
MINIBATCH_SPARSE_PCA | Mini-batch variant of sparse PCA for larger datasets. |
NMF | Non-negative matrix factorisation. Requires non-negative input. |
MINIBATCH_NMF | Mini-batch variant of NMF. |
SPARSE_CODER | Sparse coding against a pre-fitted dictionary. |
POLYNOMIAL | Polynomial feature expansion. Use degree to control the polynomial degree. |
Predefined configuration set
operations/projections_configs.py provides a ready-to-use list with one entry per projection type, each using its default number of components.
from operations.projections_configs import projections_configs
config = mll.ExperimentConfiguration(
...
projection_configs=projections_configs,
...
)Last updated on