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
in_column (str) – name of column to fit change point model
change_points_model (Optional[etna.transforms.decomposition.change_points_based.change_points_models.base.BaseChangePointsModelAdapter]) – model to get change points, by default
ruptures.detection.Binseg
in a wrapper withn_bkps=5
is usedout_column (Optional[str]) – result column name. If not given use
self.__repr__()
- 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.
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]