klsvd module¶
The Karhunen-Loève SVD algorithm to reduce the dimension of a variable.
The KLSVD
class wraps the KarhunenLoeveSVDAlgorithm
from OpenTURNS.
- class gemseo.mlearning.transform.dimension_reduction.klsvd.KLSVD(mesh, n_components=None, name='KLSVD', use_random_svd=False, n_singular_values=None, use_halko2010=True)[source]¶
Bases:
gemseo.mlearning.transform.dimension_reduction.dimension_reduction.DimensionReduction
The Karhunen-Loève SVD Algorithm.
- Parameters
mesh (ndarray) – A mesh passed as a 2D NumPy array whose rows are nodes and columns are the dimensions of the nodes.
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)
.By default it is set to None.
name (str) –
A name for this transformer.
By default it is set to KLSVD.
use_random_svd (bool) –
Whether to use a stochastic algorithm to compute the SVD decomposition; if so, the number of singular values has to be fixed a priori.
By default it is set to False.
n_singular_values (int | None) –
The number of singular values to compute when
use_random_svd
isTrue
; ifNone
, use the default value implemented by OpenTURNS.By default it is set to None.
use_halko2010 (bool) –
Whether to use the halko2010 algorithm or the halko2011 one.
By default it is set to True.
- Return type
None
- compute_jacobian(data)¶
Compute Jacobian of transformer.transform().
- Parameters
data (numpy.ndarray) – The data where the Jacobian is to be computed.
- Returns
The Jacobian matrix.
- Return type
NoReturn
- compute_jacobian_inverse(data)¶
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
NoReturn
- duplicate()¶
Duplicate the current object.
- Returns
A deepcopy of the current instance.
- Return type
- fit(data, *args)¶
Fit the transformer to the data.
- Parameters
data (numpy.ndarray) – The data to be fitted.
- Return type
NoReturn
- fit_transform(data, *args)¶
Fit the transformer to the data and transform the data.
- Parameters
data (numpy.ndarray) – The data to be transformed.
- Returns
The transformed data.
- Return type
- 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
- transform(data)[source]¶
Transform the data.
- Parameters
data (numpy.ndarray) – The data to be transformed.
- Returns
The transformed data.
- Return type
- CROSSED = False¶
- property components: numpy.ndarray¶
The principal components.
- property eigenvalues: numpy.ndarray¶
The eigen values.
- property mesh: numpy.ndarray¶
The mesh.