transformer module¶
A transformer to apply operations on NumPy arrays.
The abstract Transformer
class implements the concept of a data transformer.
Inheriting classes shall implement the Transformer.fit()
,
Transformer.transform()
and possibly Transformer.inverse_transform()
methods.
See also
Classes:
|
Transformer baseclass. |
- class gemseo.mlearning.transform.transformer.Transformer(name='Transformer', **parameters)[source]¶
Bases:
object
Transformer baseclass.
- name¶
The name of the transformer.
- Type
str
- parameters¶
The parameters of the transformer.
- Type
str
- Parameters
name (str) –
A name for this transformer.
By default it is set to Transformer.
**parameters (Optional[Union[float,int,str,bool]]) – The parameters of the transformer.
- Return type
None
Attributes:
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¶
- 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
NoReturn
- 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
NoReturn
- duplicate()[source]¶
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
NoReturn
- fit_transform(data, *args)[source]¶
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