TransformerTemplate#
- class TransformerTemplate(name: str = None)[source]#
Template class for transformers.
Classes that inherit from this template must implement the methods
fit_transform()
,transform()
, andinverse_transform()
. The optionaltransform_ddts()
method is used by the ROM class when snapshot time derivative data are available in the native state variables.See
ShiftScaleTransformer
for an example.The default implementation of
fit()
simply callsfit_transform()
.- Parameters:
- namestr
Label for the state variable that this transformer acts on.
Properties:- name#
Label for the state variable that this transformer acts on.
- state_dimension#
Dimension \(n\) of the state.
Methods:Learn (but do not apply) the transformation.
Learn and apply the transformation.
Apply the inverse of the learned transformation.
Load a previously saved transformer from an HDF5 file.
Save the transformer to an HDF5 file.
Apply the learned transformation.
Apply the learned transformation to snapshot time derivatives.
Verify that
transform()
andinverse_transform()
are consistent and thattransform_ddts()
, if implemented, is consistent withtransform()
.