class_docstr: Greedy Gaussian Segmentation.
  
  The method approximates solutions for the problem of breaking a
  multivariate time series into segments, where the data in each segment
  could be modeled as independent samples from a multivariate Gaussian
  distribution. It uses a dynamic programming search algorithm with
  a heuristic that allows finding approximate solution in linear time with
  respect to the data length and always yields locally optimal choice.
  
  Greedy Gaussian Segmentation (GGS) fits a segmented gaussian model (SGM)
  to the data by computing the approximate solution to the combinatorial
  problem of finding the approximate covariance-regularized  maximum
  log-likelihood for fixed number of change points and a reagularization
  strength. It follows an interactive procedure
  where a new breakpoint is added and then adjusting all breakpoints to
  (approximately) maximize the objective. It is similar to the top-down
  search used in other change point detection problems.
  
  Parameters
  ----------
  k_max: int, default=10
      Maximum number of change points to find. The number of segments is thus k+1.
  lamb: : float, default=1.0
      Regularization parameter lambda (>= 0), which controls the amount of
      (inverse) covariance regularization, see Eq (1) in [1]_. Regularization
      is introduced to reduce issues for high-dimensional problems. Setting
      ``lamb`` to zero will ignore regularization, whereas large values of
      lambda will favour simpler models.
  max_shuffles: int, default=250
      Maximum number of shuffles
  verbose: bool, default=False
      If ``True`` verbose output is enabled.
  random_state: int or np.random.RandomState, default=None
      Either random seed or an instance of ``np.random.RandomState``
  
  Attributes
  ----------
  change_points_: array_like, default=[]
      Locations of change points as integer indexes. By convention change points
      include the identity segmentation, i.e. first and last index + 1 values.
  _intermediate_change_points: List[List[int]], default=[]
      Intermediate values of change points for each value of k = 1...k_max
  _intermediate_ll: List[float], default=[]
      Intermediate values for log-likelihood for each value of k = 1...k_max
  
  Notes
  -----
  Based on the work from [1]_.
  
  - source code adapted based on: https://github.com/cvxgrp/GGS
  - paper available at: https://stanford.edu/~boyd/papers/pdf/ggs.pdf
  
  References
  ----------
  .. [1] Hallac, D., Nystrup, P. & Boyd, S.,
  "Greedy Gaussian segmentation of multivariate time series.",
  Adv Data Anal Classif 13, 727–751 (2019).
  https://doi.org/10.1007/s11634-018-0335-0
class_docstr_tok: ["Greedy","Gaussian","Segmentation",".","The","method","approximates","solutions","for","the","problem","of","breaking","a","multivariate","time","series","into","segments",",","where","the","data","in","each","segment","could","be","modeled","as","independent","samples","from","a","multivariate","Gaussian","distribution",".","It","uses","a","dynamic","programming","search","algorithm","with","a","heuristic","that","allows","finding","approximate","solution","in","linear","time","with","respect","to","the","data","length","and","always","yields","locally","optimal","choice",".","Greedy","Gaussian","Segmentation","(","GGS",")","fits","a","segmented","gaussian","model","(","SGM",")","to","the","data","by","computing","the","approximate","solution","to","the","combinatorial","problem","of","finding","the","approximate","covariance-regularized","maximum","log-likelihood","for","fixed","number","of","change","points","and","a","reagularization","strength",".","It","follows","an","interactive","procedure","where","a","new","breakpoint","is","added","and","then","adjusting","all","breakpoints","to","(","approximately",")","maximize","the","objective",".","It","is","similar","to","the","top-down","search","used","in","other","change","point","detection","problems",".","Parameters","--","--","--","--","--","k_max",":","int",",","default=10","Maximum","number","of","change","points","to","find",".","The","number","of","segments","is","thus","k+1",".","lamb",":",":","float",",","default=1.0","Regularization","parameter","lambda","(",">","=","0",")",",","which","controls","the","amount","of","(","inverse",")","covariance","regularization",",","see","Eq","(","1",")","in","[","1","]","_.","Regularization","is","introduced","to","reduce","issues","for","high-dimensional","problems",".","Setting","``","lamb","``","to","zero","will","ignore","regularization",",","whereas","large","values","of","lambda","will","favour","simpler","models",".","max_shuffles",":","int",",","default=250","Maximum","number","of","shuffles","verbose",":","bool",",","default=False","If","``","True","``","verbose","output","is","enabled",".","random_state",":","int","or","np.random.RandomState",",","default=None","Either","random","seed","or","an","instance","of","``","np.random.RandomState","``","Attributes","--","--","--","--","--","change_points_",":","array_like",",","default=","[","]","Locations","of","change","points","as","integer","indexes",".","By","convention","change","points","include","the","identity","segmentation",",","i.e",".","first","and","last","index","+","1","values",".","_intermediate_change_points",":","List","[","List","[","int","]","]",",","default=","[","]","Intermediate","values","of","change","points","for","each","value","of","k","=","1","...","k_max","_intermediate_ll",":","List","[","float","]",",","default=","[","]","Intermediate","values","for","log-likelihood","for","each","value","of","k","=","1","...","k_max","Notes","--","--","-","Based","on","the","work","from","[","1","]","_",".","-","source","code","adapted","based","on",":","https",":","\/\/github.com\/cvxgrp\/GGS","-","paper","available","at",":","https",":","\/\/stanford.edu\/~boyd\/papers\/pdf\/ggs.pdf","References","--","--","--","--","--","..","[","1","]","Hallac",",","D.",",","Nystrup",",","P.","&","Boyd",",","S.",",","''","Greedy","Gaussian","segmentation","of","multivariate","time","series",".","``",",","Adv","Data","Anal","Classif","13",",","727\u2013751","(","2019",")",".","https",":","\/\/doi.org\/10.1007\/s11634-018-0335-0"]
docstr: Search iteratively  for up to ``k_max`` change points.
  
  Parameters
  ----------
  data: array_like
      2D `array_like` representing time series with sequence index along
      the first dimension and value series as columns.
  
  Returns
  -------
  The K change points, along with all intermediate change points (for k < K)
  and their corresponding covariance-regularized maximum likelihoods.
docstr_tok: ["Search","iteratively","for","up","to","``","k_max","``","change","points",".","Parameters","--","--","--","--","--","data",":","array_like","2D","`","array_like","`","representing","time","series","with","sequence","index","along","the","first","dimension","and","value","series","as","columns",".","Returns","--","--","--","-","The","K","change","points",",","along","with","all","intermediate","change","points","(","for","k","<","K",")","and","their","corresponding","covariance-regularized","maximum","likelihoods","."]
code: def find_change_points(self, data: npt.ArrayLike) -> List[int]:
      """
      Search iteratively  for up to ``k_max`` change points.
  
      Parameters
      ----------
      data: array_like
          2D `array_like` representing time series with sequence index along
          the first dimension and value series as columns.
  
      Returns
      -------
      The K change points, along with all intermediate change points (for k < K)
      and their corresponding covariance-regularized maximum likelihoods.
      """
      change_points = self.identity_segmentation(data)
      self._intermediate_change_points = [change_points[:]]
      self._intermediate_ll = [
          self.cumulative_log_likelihood(data, change_points)
      ]
  
      # Start GGS Algorithm
      for _ in range(self.k_max):
          new_index = -1
          new_value = +1
          # For each segment, find change point and increase in LL
          for start, stop in zip(change_points[:-1], change_points[1:]):
              segment = data[start:stop, :]
              ind, val = self.add_new_change_point(segment)
              if val < new_value:
                  new_index = ind + start
                  new_value = val
  
          # Check if our algorithm is finished
          if new_value == 0:
              logger.info("Adding change points!")
              return change_points
  
          # Add new change point
          change_points.append(new_index)
          change_points.sort()
          if self.verbose:
              logger.info(
                  f"Change point occurs at: {new_index}, LL: {new_value}"
              )
  
          # Adjust current locations of the change points
          change_points = self.adjust_change_points(
              data, change_points, [new_index]
          )
          change_points = change_points[:]
  
          # Calculate likelihood
          ll = self.cumulative_log_likelihood(data, change_points)
          self._intermediate_change_points.append(change_points[:])
          self._intermediate_ll.append(ll)
  
      return change_points
  
imports: import logging
  import math
  from dataclasses import dataclass, field
  from typing import List, Tuple
  import numpy
  import numpy.typing
  import pandas
  from sklearn.utils.validation import check_random_state
  from sktime.annotation.base._base import BaseSeriesAnnotator
  from sktime.utils.validation._dependencies import _check_estimator_deps
label_desc: Use image node_id 7 for calling the GGS obj's underlying member method code with example usage: obj.find_change_points(data) and returns: change_points, change_points