ResampleWithDistributionTransform¶
- class ResampleWithDistributionTransform(in_column: str, distribution_column: str, inplace: bool = True, out_column: Optional[str] = None)[source]¶
Bases:
etna.transforms.base.IrreversiblePerSegmentWrapper
ResampleWithDistributionTransform resamples the given column using the distribution of the other column.
Warning
This transform can suffer from look-ahead bias. For transforming data at some timestamp it uses information from the whole train part.
Init ResampleWithDistributionTransform.
- Parameters
in_column (str) – name of column to be resampled
distribution_column (str) – name of column to obtain the distribution from
inplace (bool) –
if True, apply resampling inplace to in_column,
if False, add transformed column to dataset
out_column (Optional[str]) – name of added column. If not given, use
self.__repr__()
- Inherited-members
Methods
fit
(ts)Fit the transform.
fit_transform
(ts)Fit and transform TSDataset.
Return the list with regressors created by the transform.
inverse_transform
(ts)Inverse transform TSDataset.
load
(path)Load an object.
params_to_tune
()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.missing_values.resample.ResampleWithDistributionTransform [source]¶
Fit the transform.
- Parameters
- Return type
etna.transforms.missing_values.resample.ResampleWithDistributionTransform