_OneSegmentTrendTransform

class _OneSegmentTrendTransform(in_column: str, out_column: str, change_point_model: ruptures.base.BaseEstimator, detrend_model: Type[sklearn.base.RegressorMixin], **change_point_model_predict_params)[source]

Bases: etna.transforms.decomposition.change_points_trend._OneSegmentChangePointsTrendTransform

_OneSegmentTrendTransform adds trend as a feature.

Init _OneSegmentTrendTransform.

Parameters
  • in_column (str) – name of column to apply transform to

  • out_column (str) – name of added column

  • change_point_model (ruptures.base.BaseEstimator) – model to get trend change points

  • detrend_model (Type[sklearn.base.RegressorMixin]) – model to get trend from data

  • change_point_model_predict_params – params for change_point_model.predict method

Inherited-members

Methods

fit(df)

Fit OneSegmentChangePointsTransform: find trend change points in df, fit detrend models with data from intervals of stable trend.

fit_transform(df)

May be reimplemented.

inverse_transform(df)

Inverse transform dataframe.

transform(df)

Add column with trend, got from the detrend_model.

inverse_transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Inverse transform dataframe.

Parameters

df (pandas.core.frame.DataFrame) – one segment dataframe

Returns

given dataframe

Return type

pd.DataFrame

transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame[source]

Add column with trend, got from the detrend_model.

Parameters

df (pandas.core.frame.DataFrame) – data to get trend from

Returns

df with trend column

Return type

pd.DataFrame