_OneSegmentChangePointsTransform¶
- class _OneSegmentChangePointsTransform(in_column: str, change_points_model: etna.transforms.decomposition.change_points_based.change_points_models.base.BaseChangePointsModelAdapter, per_interval_model: etna.transforms.decomposition.change_points_based.per_interval_models.base.PerIntervalModel)[source]¶
Bases:
etna.transforms.base.OneSegmentTransform
,abc.ABC
Init _OneSegmentChangePointsTransform.
- Parameters
in_column (str) – name of column to apple transform to
change_points_model (etna.transforms.decomposition.change_points_based.change_points_models.base.BaseChangePointsModelAdapter) – model to get change points from data
per_interval_model (etna.transforms.decomposition.change_points_based.per_interval_models.base.PerIntervalModel) – model to process intervals between change points
- Inherited-members
Methods
fit
(df)Fit transform.
fit_transform
(df)Fit and transform Dataframe.
Split df to intervals of stable trend according to previous change point detection and add trend to each one.
set_params
(**params)Return new object instance with modified parameters.
to_dict
()Collect all information about etna object in dict.
transform
(df)Transform data from df.
- fit(df: pandas.core.frame.DataFrame) etna.transforms.decomposition.change_points_based.base._OneSegmentChangePointsTransform [source]¶
Fit transform. Get no-changepoints intervals with change_points_model and fit per_interval_model on the intervals.
- Parameters
df (pandas.core.frame.DataFrame) – dataframe to process
- Returns
fitted _OneSegmentChangePointsTransform
- Return type
self
- inverse_transform(df: pandas.core.frame.DataFrame) pandas.core.frame.DataFrame [source]¶
Split df to intervals of stable trend according to previous change point detection and add trend to each one.
- Parameters
df (pandas.core.frame.DataFrame) – one segment dataframe to turn trend back
- Returns
df – df with restored trend in in_column
- Return type
pd.DataFrame