Skip to Content

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

TypeDescription
NONENo projection. The full transformed feature matrix is passed to the model.
PCAPrincipal component analysis.
INCREMENTAL_PCAIncremental PCA for datasets that do not fit in memory.
KERNEL_PCAKernel PCA, enabling non-linear projections via a kernel function.
TRUNCATED_SVDTruncated singular value decomposition (LSA). Does not centre the data and is sparse-compatible.
FAST_ICAFast independent component analysis.
SPARSE_PCASparse PCA, where components are constrained to be sparse.
MINIBATCH_SPARSE_PCAMini-batch variant of sparse PCA for larger datasets.
NMFNon-negative matrix factorisation. Requires non-negative input.
MINIBATCH_NMFMini-batch variant of NMF.
SPARSE_CODERSparse coding against a pre-fitted dictionary.
POLYNOMIALPolynomial 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