class_docstr: Random interval feature transformer.
  
  Extracts intervals with random length, position and dimension from series in fit.
  Transforms each interval subseries using the given transformer(s) and concatenates
  them into a feature vector in transform.
  
  Currently, the transform is re-fit for every interval in transform. As such, it may
  not be suitable for some supervised transformers in its current state.
  
  Parameters
  ----------
  n_intervals : int, default=100,
      The number of intervals of random length, position and dimension to be
      extracted.
  transformers : transformer or list of transformers, default=None,
      Transformer(s) used to extract features from each interval. If None, defaults to
      the SummaryTransformer using
      [mean, median, min, max, std, 25% quantile, 75% quantile]
  n_jobs : int, default=1
      The number of jobs to run in parallel for both `fit` and `predict`.
      ``-1`` means using all processors.
  random_state : int or None, default=None
      Seed for random, integer.
  
  See Also
  --------
  SupervisedIntervals
docstr: Fit the random interval transform.
  
  Parameters
  ----------
  X : pandas DataFrame or 3d numpy array, input time series
  y : array_like, target values (optional, ignored)
code: def _fit(self, X, y=None):
      """Fit the random interval transform.
  
      Parameters
      ----------
      X : pandas DataFrame or 3d numpy array, input time series
      y : array_like, target values (optional, ignored)
      """
      _, n_dims, series_length = X.shape
  
      if self.transformers is None:
          self._transformers = [
              SummaryTransformer(
                  summary_function=("mean", "std", "min", "max"),
                  quantiles=(0.25, 0.5, 0.75),
              )
          ]
  
      if not isinstance(self._transformers, list):
          self._transformers = [self._transformers]
  
      li = []
      for i in range(len(self._transformers)):
          li.append(
              _clone_estimator(
                  self._transformers[i],
                  self.random_state,
              )
          )
  
          m = getattr(li[i], "n_jobs", None)
          if m is not None:
              li[i].n_jobs = self.n_jobs
      self._transformers = li
  
      rng = check_random_state(self.random_state)
      self._dims = rng.choice(n_dims, self.n_intervals, replace=True)
      self._intervals = np.zeros((self.n_intervals, 2), dtype=int)
  
      for i in range(0, self.n_intervals):
          if rng.random() < 0.5:
              self._intervals[i][0] = rng.randint(0, series_length - 3)
              length = (
                  rng.randint(
                      0, series_length - self._intervals[i][0] - 3
                  )
                  + 3
                  if series_length - self._intervals[i][0] - 3 > 0
                  else 3
              )
              self._intervals[i][1] = self._intervals[i][0] + length
          else:
              self._intervals[i][1] = (
                  rng.randint(0, series_length - 3) + 3
              )
              length = (
                  rng.randint(0, self._intervals[i][1] - 3) + 3
                  if self._intervals[i][1] - 3 > 0
                  else 3
              )
              self._intervals[i][0] = self._intervals[i][1] - length
      return self
  
file_path: sktime/sktime/transformations/panel/random_intervals.py
imports: import numpy
  import pandas
  from sklearn.utils import check_random_state
  from sktime.base._base import _clone_estimator
  from sktime.transformations.base import BaseTransformer
  from sktime.transformations.series.summarize import SummaryTransformer
label_desc: Use image node_id 2 for calling the RandomIntervals obj's underlying member method code with example usage: obj._fit(X, y) and returns: self