gemseo / mlearning / transformers / dimension_reduction

Hide inherited members

dimension_reduction module

Dimension reduction as a generic transformer.

The DimensionReduction class implements the concept of dimension reduction.

See also

pca

class gemseo.mlearning.transformers.dimension_reduction.dimension_reduction.DimensionReduction(name='', n_components=None, **parameters)[source]

Bases: Transformer

Dimension reduction.

Parameters:
  • name (str) –

    A name for this transformer.

    By default it is set to “”.

  • 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).

  • **parameters (bool | int | float | str | None) – The parameters of the transformer.

compute_jacobian(data)

Compute the Jacobian of transform().

Parameters:

data (ndarray) – The data where the Jacobian is to be computed, shaped as (n_observations, n_features) or (n_features, ).

Returns:

The Jacobian matrix, shaped according to data.

Return type:

NoReturn

compute_jacobian_inverse(data)

Compute the Jacobian of the inverse_transform().

Parameters:

data (ndarray) – The data where the Jacobian is to be computed, shaped as (n_observations, n_features) or (n_features, ).

Returns:

The Jacobian matrix, shaped according to data..

Return type:

NoReturn

duplicate()

Duplicate the current object.

Returns:

A deepcopy of the current instance.

Return type:

Transformer

fit(data, *args)

Fit the transformer to the data.

Parameters:
  • data (ndarray) – The data to be fitted, shaped as (n_observations, n_features) or (n_observations, ).

  • args (float | int | str) –

Return type:

None

fit_transform(data, *args)

Fit the transformer to the data and transform the data.

Parameters:
  • data (ndarray) – The data to be transformed, shaped as (n_observations, n_features) or (n_observations, ).

  • args (float | int | str) –

Returns:

The transformed data, shaped as data.

Return type:

ndarray

inverse_transform(data)

Perform an inverse transform on the data.

Parameters:

data (ndarray) – The data to be inverse transformed, shaped as (n_observations, n_features) or (n_features, ).

Returns:

The inverse transformed data, shaped as data.

Return type:

NoReturn

abstract transform(data)

Transform the data.

Parameters:

data (ndarray) – The data to be transformed, shaped as (n_observations, n_features) or (n_features, ).

Returns:

The transformed data, shaped as data.

Return type:

ndarray

CROSSED: ClassVar[bool] = False

Whether the fit() method requires two data arrays.

property is_fitted: bool

Whether the transformer has been fitted from some data.

property n_components: int

The number of components.

name: str

The name of the transformer.

property parameters: dict[str, bool | int | float | ndarray | str | None]

The parameters of the transformer.

Examples using DimensionReduction

KL-SVD on Burgers equation

KL-SVD on Burgers equation

PCA on Burgers equation

PCA on Burgers equation