ResampleWithDistributionTransform

class ResampleWithDistributionTransform(in_column: str, distribution_column: str, inplace: bool = True, out_column: Optional[str] = None)[source]

Bases: etna.transforms.base.PerSegmentWrapper

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(df)

Fit transform on each segment.

fit_transform(df)

May be reimplemented.

inverse_transform(df)

Apply inverse_transform to each segment.

transform(df)

Apply transform to each segment separately.