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.transformers.dimension_reduction.klsvd.KLSVD(mesh, n_components=None, name='', use_random_svd=False, n_singular_values=None, use_halko2010=True)[source]
Bases:
BaseDimensionReduction
The Karhunen-Loève SVD algorithm based on OpenTURNS.
- Parameters:
mesh (RealArray) – 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 “”.
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.
- inverse_transform(data, *args, **kwargs)
Force a NumPy array to be 2D and evaluate the function
f
with it.
- transform(data, *args, **kwargs)
Force a NumPy array to be 2D and evaluate the function
f
with it.
- property components: RealArray
The principal components.
- property eigenvalues: RealArray
The eigen values.
- property mesh: RealArray
The mesh.
- name: str
The name of the transformer.
- property output_dimension: int
The dimension of the latent space.