ChangePointsSegmentationTransform

class ChangePointsSegmentationTransform(in_column: str, change_points_model: Optional[etna.transforms.decomposition.change_points_based.change_points_models.base.BaseChangePointsModelAdapter] = None, out_column: Optional[str] = None)[source]

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

Transform that makes label encoding of change-point intervals.

Transform divides each segment into intervals using change_points_model. Each interval is enumerated based on its index from the start of the segment. New column is created with number of interval for each timestamp.

Warning

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

Init ChangePointsSegmentationTransform.

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.

Attributes

out_column

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]