gemseo.mlearning.transformers.dimension_reduction.pls module#
The Partial Least Square (PLS) regression to reduce the dimension of a variable.
The PLS class wraps the PCA from Scikit-learn.
Dependence#
This dimension reduction algorithm relies on the PLSRegression class of the scikit-learn library.
- class PLS(name='', n_components=None, **parameters)[source]#
Bases:
BaseDimensionReductionPartial Least Square regression.
- 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, typicallymin(n_samples, n_features).**parameters (float | bool) -- The optional parameters for sklearn PCA constructor.
- inverse_transform(data, *args, **kwargs)#
Force a NumPy array to be at least 2D and evaluate the function
f.fexpects a 2D array shaped as(n_points, input_dimension)and returns a nD arrays shaped as(..., n_points, output_dimension)or(..., n_points, output_dimension, input_dimension).If the original
datais a 1D array shaped as(input_dimension,), then this wrapper returns a (n-1)D array shaped as(..., output_dimension)or(..., output_dimension, intput_dimension).
- transform(data, *args, **kwargs)#
Force a NumPy array to be at least 2D and evaluate the function
f.fexpects a 2D array shaped as(n_points, input_dimension)and returns a nD arrays shaped as(..., n_points, output_dimension)or(..., n_points, output_dimension, input_dimension).If the original
datais a 1D array shaped as(input_dimension,), then this wrapper returns a (n-1)D array shaped as(..., output_dimension)or(..., output_dimension, intput_dimension).