class_docstr: Interval segmentation transformer.
  
  Parameters
  ----------
  intervals : int, np.ndarray or list of np.ndarrays with one for each
  column of input data.
      Intervals to generate.
      - If int, intervals gives the number of generated intervals.
      - If ndarray, 2d np.ndarray [n_intervals, 2] with rows giving
      intervals, the first column giving start points,
      and the second column giving end points of intervals
  
  Examples
  --------
  >>> from sktime.utils._testing.panel import _make_panel
  >>> from sktime.transformations.panel.segment import IntervalSegmenter
  
  >>> X = _make_panel()
  >>> t = IntervalSegmenter()
  >>> Xt = t.fit_transform(X)
class_docstr_tok: ["Interval","segmentation","transformer",".","Parameters","--","--","--","--","--","intervals",":","int",",","np.ndarray","or","list","of","np.ndarrays","with","one","for","each","column","of","input","data",".","Intervals","to","generate",".","-","If","int",",","intervals","gives","the","number","of","generated","intervals",".","-","If","ndarray",",","2d","np.ndarray","[","n_intervals",",","2","]","with","rows","giving","intervals",",","the","first","column","giving","start","points",",","and","the","second","column","giving","end","points","of","intervals","Examples","--","--","--","--",">",">",">","from","sktime.utils._testing.panel","import","_make_panel",">",">",">","from","sktime.transformations.panel.segment","import","IntervalSegmenter",">",">",">","X","=","_make_panel","(",")",">",">",">","t","=","IntervalSegmenter","(",")",">",">",">","Xt","=","t.fit_transform","(","X",")"]
docstr: Fit transformer, generating random interval indices.
  
  Parameters
  ----------
  X : nested pandas DataFrame of shape [n_instances, n_features]
      each cell of X must contain pandas.Series
      Data to fit transform to
  y : ignored argument for interface compatibility
      Additional data, e.g., labels for transformation
  
  Returns
  -------
  self : an instance of self.
docstr_tok: ["Fit","transformer",",","generating","random","interval","indices",".","Parameters","--","--","--","--","--","X",":","nested","pandas","DataFrame","of","shape","[","n_instances",",","n_features","]","each","cell","of","X","must","contain","pandas.Series","Data","to","fit","transform","to","y",":","ignored","argument","for","interface","compatibility","Additional","data",",","e.g.",",","labels","for","transformation","Returns","--","--","--","-","self",":","an","instance","of","self","."]
code: def _fit(self, X, y=None):
      """Fit transformer, generating random interval indices.
  
      Parameters
      ----------
      X : nested pandas DataFrame of shape [n_instances, n_features]
          each cell of X must contain pandas.Series
          Data to fit transform to
      y : ignored argument for interface compatibility
          Additional data, e.g., labels for transformation
  
      Returns
      -------
      self : an instance of self.
      """
      n_timepoints = len(get_time_index(X))
  
      self._time_index = np.arange(n_timepoints)
  
      if isinstance(self.intervals, np.ndarray):
          self.intervals_ = list(self.intervals)
  
      elif isinstance(self.intervals, (int, np.integer)):
          if not self.intervals <= n_timepoints // 2:
              raise ValueError(
                  "The number of intervals must be half the number of time points"
                  " or less"
              )
          ints = np.array_split(self._time_index, self.intervals)
          ints = [x[[0, -1]] for x in ints]
          self.intervals_ = ints
  
      else:
          raise ValueError(
              f"Intervals must be either an integer, an array with "
              f"start and end points, but found: {self.intervals}"
          )
      return self
  
imports: import math
  import numpy
  import pandas
  from sklearn.utils import check_random_state
  from sktime.datatypes._utilities import get_time_index
  from sktime.transformations._delegate import _DelegatedTransformer
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import check_window_length
label_desc: Use image node_id 2 for calling the IntervalSegmenter obj's underlying member method code with example usage: obj._fit(X, y) and returns: self