LinearTrendTransform¶
- class LinearTrendTransform(in_column: str, poly_degree: int = 1, **regression_params)[source]¶
Bases:
etna.transforms.base.PerSegmentWrapper
Transform that uses
sklearn.linear_model.LinearRegression
to find linear or polynomial trend in data.Warning
This transform can suffer from look-ahead bias. For transforming data at some timestamp it uses information from the whole train part.
Create instance of LinearTrendTransform.
- Parameters
in_column (str) – name of processed column
poly_degree (int) – degree of polynomial to fit trend on
regression_params – params that should be used to init
sklearn.linear_model.LinearRegression
- 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.