LagTransform¶
- class LagTransform(in_column: str, lags: Union[List[int], int], out_column: Optional[str] = None)[source]¶
Bases:
etna.transforms.base.PerSegmentWrapper
,etna.transforms.base.FutureMixin
Generates series of lags from given dataframe.
Create instance of LagTransform.
- Parameters
in_column (str) – name of processed column
lags (Union[List[int], int]) – int value or list of values for lags computation; if int, generate range of lags from 1 to given value
out_column (Optional[str]) –
base for the name of created columns;
if set the final name is ‘{out_column}_{lag_number}’;
if don’t set, name will be
transform.__repr__()
, repr will be made for transform that creates exactly this column
- Raises
ValueError: – if lags value contains non-positive values
- 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.