Transform¶
- class Transform(required_features: Union[Literal['all'], List[str]])[source]¶
Bases:
etna.core.mixins.SaveMixin
,etna.core.mixins.BaseMixin
Base class to create any transforms to apply to data.
- Inherited-members
- Parameters
required_features (Union[Literal['all'], typing.List[str]]) –
Methods
fit
(ts)Fit the transform.
fit_transform
(ts)Fit and transform TSDataset.
Return the list with regressors created by the transform.
Inverse transform TSDataset.
load
(path)Load an object.
Get grid for tuning hyperparameters.
save
(path)Save the object.
set_params
(**params)Return new object instance with modified parameters.
to_dict
()Collect all information about etna object in dict.
transform
(ts)Transform TSDataset inplace.
- fit(ts: etna.datasets.tsdataset.TSDataset) etna.transforms.base.Transform [source]¶
Fit the transform.
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – Dataset to fit the transform on.
- Returns
The fitted transform instance.
- Return type
- fit_transform(ts: etna.datasets.tsdataset.TSDataset) etna.datasets.tsdataset.TSDataset [source]¶
Fit and transform TSDataset.
May be reimplemented. But it is not recommended.
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – TSDataset to transform.
- Returns
Transformed TSDataset.
- Return type
- abstract get_regressors_info() List[str] [source]¶
Return the list with regressors created by the transform.
- Returns
List with regressors created by the transform.
- Return type
List[str]
- abstract inverse_transform(ts: etna.datasets.tsdataset.TSDataset) etna.datasets.tsdataset.TSDataset [source]¶
Inverse transform TSDataset.
Should be reimplemented in the subclasses where necessary.
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – TSDataset to be inverse transformed.
- Returns
TSDataset after applying inverse transformation.
- Return type
- params_to_tune() Dict[str, etna.distributions.distributions.BaseDistribution] [source]¶
Get grid for tuning hyperparameters.
This is default implementation with empty grid.
- Returns
Empty grid.
- Return type
Dict[str, etna.distributions.distributions.BaseDistribution]
- transform(ts: etna.datasets.tsdataset.TSDataset) etna.datasets.tsdataset.TSDataset [source]¶
Transform TSDataset inplace.
- Parameters
ts (etna.datasets.tsdataset.TSDataset) – Dataset to transform.
- Returns
Transformed TSDataset.
- Return type