_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
Inherited-members

Methods

fit(df)

Fit transform.

fit_transform(df)

Fit and transform Dataframe.

inverse_transform(df)

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

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

Transform data from df.

Parameters

df (pandas.core.frame.DataFrame) – dataframe to apply transformation to

Returns

dataframe with applied transformation

Return type

transformed_df