_OneSegmentSTLTransform¶
- class _OneSegmentSTLTransform(in_column: str, period: int, model: Union[str, statsmodels.tsa.base.tsa_model.TimeSeriesModel] = 'arima', robust: bool = False, model_kwargs: Optional[Dict[str, Any]] = None, stl_kwargs: Optional[Dict[str, Any]] = None)[source]¶
Bases:
etna.transforms.base.OneSegmentTransform
Init _OneSegmentSTLTransform.
- Parameters
in_column (str) – name of processed column
period (int) – size of seasonality
model (Union[str, statsmodels.tsa.base.tsa_model.TimeSeriesModel]) –
model to predict trend, default options are:
”arima”:
ARIMA(data, 1, 1, 0)
(default)”holt”:
ETSModel(data, trend='add')
Custom model should be a subclass of
statsmodels.tsa.base.tsa_model.TimeSeriesModel
and have methodget_prediction
(not justpredict
)robust (bool) – flag indicating whether to use robust version of STL
model_kwargs (Optional[Dict[str, Any]]) – parameters for the model like in
statsmodels.tsa.seasonal.STLForecast
stl_kwargs (Optional[Dict[str, Any]]) – additional parameters for
statsmodels.tsa.seasonal.STLForecast
- Inherited-members
Methods
fit
(df)Perform STL decomposition and fit trend model.
fit_transform
(df)Fit and transform Dataframe.
Add trend and seasonal component.
set_params
(**params)Return new object instance with modified parameters.
to_dict
()Collect all information about etna object in dict.
transform
(df)Subtract trend and seasonal component.
- fit(df: pandas.core.frame.DataFrame) etna.transforms.decomposition.stl._OneSegmentSTLTransform [source]¶
Perform STL decomposition and fit trend model.
- Parameters
df (pandas.core.frame.DataFrame) – Features dataframe with time
- Returns
result – instance after processing
- Return type