class_docstr: Mixin with methods useful for segmentation problems.
class_docstr_tok: ["Mixin","with","methods","useful","for","segmentation","problems","."]
docstr: Convert change point locations to a clustering vector.
  
  Change point detection results can be treated as clustering
  with each segment separated by change points assigned a
  distinct dummy label.
  
  For example change points [2, 8] for a time series of length 10
  would result in: [0, 0, 1, 1, 1, 1, 1, 1, 2, 2].
docstr_tok: ["Convert","change","point","locations","to","a","clustering","vector",".","Change","point","detection","results","can","be","treated","as","clustering","with","each","segment","separated","by","change","points","assigned","a","distinct","dummy","label",".","For","example","change","points","[","2",",","8","]","for","a","time","series","of","length","10","would","result","in",":","[","0",",","0",",","1",",","1",",","1",",","1",",","1",",","1",",","2",",","2","]","."]
code: def to_clusters(self, change_points: List[int]) -> npt.ArrayLike:
      """Convert change point locations to a clustering vector.
  
      Change point detection results can be treated as clustering
      with each segment separated by change points assigned a
      distinct dummy label.
  
      For example change points [2, 8] for a time series of length 10
      would result in: [0, 0, 1, 1, 1, 1, 1, 1, 2, 2].
      """
      labels = np.zeros(change_points[-1], dtype=np.int32)
      for i, (start, stop) in enumerate(
          zip(change_points[:-1], change_points[1:])
      ):
          labels[start:stop] = i
      return labels
  
imports: from dataclasses import asdict, dataclass, field
  from typing import Dict, List
  import numpy
  import numpy.typing
  import pandas
  from sktime.base import BaseEstimator
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 2 for calling the SegmentationMixin obj's underlying member method code with example usage: obj.to_clusters(change_points) and returns: labels