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.
Classes:
|
Principal component dimension reduction algorithm. |
- class gemseo.mlearning.transform.dimension_reduction.pca.PCA(name='PCA', n_components=5, **parameters)[source]¶
Bases:
gemseo.mlearning.transform.dimension_reduction.dimension_reduction.DimensionReduction
Principal component dimension reduction algorithm.
- name¶
The name of the transformer.
- Type
str
- parameters¶
The parameters of the transformer.
- Type
str
- Parameters
**parameters (Optional[Union[float,int,str,bool]]) – The optional parameters for sklearn PCA constructor.
name (str,) –
By default it is set to PCA.
n_components (int) –
By default it is set to 5.
- Return type
None
Attributes:
The principal components.
The number of components.
Methods:
compute_jacobian
(data)Compute Jacobian of transformer.transform().
compute_jacobian_inverse
(data)Compute Jacobian of the transformer.inverse_transform().
Duplicate the current object.
fit
(data, *args)Fit the transformer to the data.
fit_transform
(data, *args)Fit the transformer to the data and transform the data.
inverse_transform
(data)Perform an inverse transform on the data.
transform
(data)Transform the data.
- CROSSED = False¶
- property components¶
The principal components.
- 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
- fit(data, *args)[source]¶
Fit the transformer to the data.
- Parameters
data (numpy.ndarray) – The data to be fitted.
*args (Union[float, int, str]) –
- Return type
None
- fit_transform(data, *args)¶
Fit the transformer to the data and transform the data.
- Parameters
data (numpy.ndarray) – The data to be transformed.
*args (Union[float, int, str]) –
- 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
- property n_components¶
The number of components.