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:
DimensionReduction
The Karhunen-Loève SVD algorithm.
Based on OpenTURNS.
Warning
Under Python 3.7, GEMSEO requires openturns 1.19 which removes the non-significant components, whatever the value of
n_components
passed at instantiation. Under Python 3.8 and above, the number of components is equal ton_components
if notNone
, otherwise to the mesh size.- 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)
.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.use_halko2010 (bool) –
Whether to use the halko2010 algorithm or the halko2011 one.
By default it is set to True.
- compute_jacobian(data)¶
Compute Jacobian of transformer.transform().
- compute_jacobian_inverse(data)¶
Compute Jacobian of the transformer.inverse_transform().
- duplicate()¶
Duplicate the current object.
- Returns:
A deepcopy of the current instance.
- Return type:
- fit(data, *args)¶
Fit the transformer to the data.
- fit_transform(data, *args)¶
Fit the transformer to the data and transform the data.