gemseo / mlearning / transform / dimension_reduction

pca module

The Principal Component Analysis (PCA) to reduce the dimension of a variable.

The PCA class wraps the PCA from Scikit-learn.

Dependence

This dimension reduction algorithm relies on the PCA class of the scikit-learn library.

class gemseo.mlearning.transform.dimension_reduction.pca.PCA(name='PCA', n_components=None, **parameters)[source]

Bases: gemseo.mlearning.transform.dimension_reduction.dimension_reduction.DimensionReduction

Principal component dimension reduction algorithm.

Parameters
  • name (str) –

    A name for this transformer.

    By default it is set to PCA.

  • n_components (int | None) –

    The number of components of the latent space. If None, use the maximum number allowed by the technique, typically min(n_samples, n_features).

    By default it is set to None.

  • **parameters (float | int | str | bool | None) – The optional parameters for sklearn PCA constructor.

Return type

None

compute_jacobian(data)[source]

Compute Jacobian of transformer.transform().

Parameters

data (numpy.ndarray) – The data where the Jacobian is to be computed.

Returns

The Jacobian matrix.

Return type

numpy.ndarray

compute_jacobian_inverse(data)[source]

Compute Jacobian of the transformer.inverse_transform().

Parameters

data (numpy.ndarray) – The data where the Jacobian is to be computed.

Returns

The Jacobian matrix.

Return type

numpy.ndarray

duplicate()

Duplicate the current object.

Returns

A deepcopy of the current instance.

Return type

gemseo.mlearning.transform.transformer.Transformer

fit(data, *args)

Fit the transformer to the data.

Parameters
Return type

NoReturn

fit_transform(data, *args)

Fit the transformer to the data and transform the data.

Parameters
Returns

The transformed data.

Return type

numpy.ndarray

inverse_transform(data)[source]

Perform an inverse transform on the data.

Parameters

data (numpy.ndarray) – The data to be inverse transformed.

Returns

The inverse transformed data.

Return type

numpy.ndarray

transform(data)[source]

Transform the data.

Parameters

data (numpy.ndarray) – The data to be transformed.

Returns

The transformed data.

Return type

numpy.ndarray

CROSSED = False
property components: numpy.ndarray

The principal components.

property n_components: int

The number of components.

name: str

The name of the transformer.

parameters: str

The parameters of the transformer.