TheilSenTrendTransform¶
- class TheilSenTrendTransform(in_column: str, poly_degree: int = 1, **regression_params)[source]¶
Bases:
etna.transforms.base.PerSegmentWrapper
Transform that uses
sklearn.linear_model.TheilSenRegressor
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.
Notes
Setting parameter
n_subsamples
manually might cause the error. It should be at least the number of features (plus 1 iffit_intercept=True
) and the number of samples in the shortest segment as a maximum.Create instance of TheilSenTrendTransform.
- 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.TheilSenRegressor
- 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.