etna.experimental.change_points.get_ruptures_regularization#

get_ruptures_regularization(ts: TSDataset, in_column: str, change_point_model: BaseEstimator, n_bkps: Dict[str, int] | int, mode: OptimizationMode, max_value: float = 10000, max_iters: int = 200) Dict[str, Dict[str, float]][source]#

Get regularization parameter values for given number of changepoints.

It is assumed that as the regularization being selected increases, the number of change points decreases.

Parameters:
  • ts (TSDataset) – Dataset with timeseries data

  • in_column (str) – name of processed column

  • change_point_model (BaseEstimator) – model to get trend change points

  • n_bkps (Dict[str, int] | int) – target numbers of changepoints

  • mode (OptimizationMode) – optimization mode

  • max_value (float) – maximum possible value, the upper bound for search

  • max_iters (int) – maximum iterations; in case if the required number of points is unattainable, values will be selected after max_iters iterations

Returns:

regularization parameters values in dictionary format {segment: {mode: value}}.

Raises:
  • ValueError: – If max_value is too low for needed n_bkps

  • ValueError: – If n_bkps is too high for this series

Return type:

Dict[str, Dict[str, float]]