ChangePointsLevelTransform

class ChangePointsLevelTransform(in_column: str, change_points_model: Optional[etna.transforms.decomposition.change_points_based.change_points_models.base.BaseChangePointsModelAdapter] = None, per_interval_model: Optional[etna.transforms.decomposition.change_points_based.per_interval_models.statistics_based.StatisticsPerIntervalModel] = None)[source]

Bases: etna.transforms.decomposition.change_points_based.base.ReversibleChangePointsTransform

Transform that makes a detrending of change-point intervals.

This class differs from ChangePointsTrendTransform only by default values for change_points_model and per_interval_model.

Transform divides each segment into intervals using change_points_model. Then a separate model is fitted on each interval using per_interval_model. Values predicted by the model are subtracted from each interval.

Evaluated function can be linear, mean, median, etc. Look at the signature to find out which models can be used.

Warning

This transform can suffer from look-ahead bias. For transforming data at some timestamp it uses information from the whole train part.

Init ChangePointsTrendTransform.

Parameters
Inherited-members

Methods

fit(ts)

Fit the transform.

fit_transform(ts)

Fit and transform TSDataset.

get_regressors_info()

Return the list with regressors created by the transform.

inverse_transform(ts)

Inverse transform TSDataset.

load(path)

Load an object.

params_to_tune()

Get default grid for tuning hyperparameters.

save(path)

Save the object.

set_params(**params)

Return new object instance with modified parameters.

to_dict()

Collect all information about etna object in dict.

transform(ts)

Transform TSDataset inplace.

params_to_tune() Dict[str, etna.distributions.distributions.BaseDistribution][source]

Get default grid for tuning hyperparameters.

If self.change_points_model is equal to default then this grid tunes parameters: change_points_model.change_points_model.model, change_points_model.n_bkps. Other parameters are expected to be set by the user.

Returns

Grid to tune.

Return type

Dict[str, etna.distributions.distributions.BaseDistribution]