class_docstr: Random Interval Spectral Ensemble (RISE).
  
  Input: n series length m
  For each tree
      - sample a random intervals
      - take the ACF and PS over this interval, and concatenate features
      - build tree on new features
  Ensemble the trees through averaging probabilities.
  
  Parameters
  ----------
  n_estimators : int, default=200
      The number of trees in the forest.
  min_interval : int, default=16
      The minimum width of an interval.
  acf_lag : int, default=100
      The maximum number of autocorrelation terms to use.
  acf_min_values : int, default=4
      Never use fewer than this number of terms to find a correlation.
  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, RandomState instance or None, default=None
      If int, random_state is the seed used by the random number generator;
      If RandomState instance, random_state is the random number generator;
      If None, the random number generator is the RandomState instance used
      by `np.random`.
  
  Attributes
  ----------
  n_classes_ : int
      The number of classes.
  classes_ : list
      The classes labels.
  intervals_ : array of shape = [n_estimators][2]
      Stores indexes of start and end points for all classifiers.
  
  Notes
  -----
  For the Java version, see
  `TSML <https://github.com/uea-machine-learning/tsml/blob/master/src/main/java/tsml/
  classifiers/interval_based/RISE.java>`_.
  
  References
  ----------
  .. [1] Jason Lines, Sarah Taylor and Anthony Bagnall, "Time Series Classification
     with HIVE-COTE: The Hierarchical Vote Collective of Transformation-Based
     Ensembles", ACM Transactions on Knowledge and Data Engineering, 12(5): 2018
docstr: Build a forest of trees from the training set (X, y).
  
  using random intervals and spectral features.
  
  Parameters
  ----------
  X : array-like or sparse matrix of shape = [n_instances,
  series_length] or shape = [n_instances,n_columns]
      The training input samples. If a Pandas data frame is passed it
      must have a single column (i.e., univariate classification).
      RISE has no bespoke method for multivariate classification as yet.
  y : array-like, shape = [n_instances]
      The class labels.
  
  Returns
  -------
  self : object
docstr_tok: ["Build","a","forest","of","trees","from","the","training","set","(","X",",","y",")",".","using","random","intervals","and","spectral","features",".","Parameters","--","--","--","--","--","X",":","array-like","or","sparse","matrix","of","shape","=","[","n_instances",",","series_length","]","or","shape","=","[","n_instances",",","n_columns","]","The","training","input","samples",".","If","a","Pandas","data","frame","is","passed","it","must","have","a","single","column","(","i.e.",",","univariate","classification",")",".","RISE","has","no","bespoke","method","for","multivariate","classification","as","yet",".","y",":","array-like",",","shape","=","[","n_instances","]","The","class","labels",".","Returns","--","--","--","-","self",":","object"]
code: def _fit(self, X, y):
      """Build a forest of trees from the training set (X, y).
  
      using random intervals and spectral features.
  
      Parameters
      ----------
      X : array-like or sparse matrix of shape = [n_instances,
      series_length] or shape = [n_instances,n_columns]
          The training input samples. If a Pandas data frame is passed it
          must have a single column (i.e., univariate classification).
          RISE has no bespoke method for multivariate classification as yet.
      y : array-like, shape = [n_instances]
          The class labels.
  
      Returns
      -------
      self : object
      """
      X = X.squeeze(1)
      n_instances, self.series_length = X.shape
      self.min_interval_, self.max_interval_ = (
          self.min_interval,
          self.max_interval,
      )
      if self.max_interval_ not in range(1, self.series_length):
          self.max_interval_ = self.series_length
      if self.min_interval_ not in range(1, self.series_length + 1):
          self.min_interval_ = self.series_length // 2
  
      rng = check_random_state(self.random_state)
  
      self.estimators_ = []
      # self.intervals = _produce_intervals(
      #     self.n_estimators,
      #     self.min_interval,
      #     self.max_interval,
      #     self.series_length,
      #     rng
      # )
      self.intervals_ = np.empty((self.n_estimators, 2), dtype=int)
      self.intervals_[:] = [
          _select_interval(
              self.min_interval_,
              self.max_interval_,
              self.series_length,
              rng,
          )
          for _ in range(self.n_estimators)
      ]
  
      # Check lag against global properties
      self.acf_lag_ = self.acf_lag
      if self.acf_lag > self.series_length - self.acf_min_values:
          self.acf_lag_ = self.series_length - self.acf_min_values
      if self.acf_lag < 0:
          self.acf_lag_ = 1
      self.lags = np.zeros(self.n_estimators, dtype=int)
  
      trees = [
          _make_estimator(
              self.base_estimator,
              random_state=rng.randint(np.iinfo(np.int32).max),
          )
          for _ in range(self.n_estimators)
      ]
  
      # Parallel loop
      worker_rets = Parallel(n_jobs=self._threads_to_use)(
          delayed(_parallel_build_trees)(
              X,
              y,
              tree,
              self.intervals_[i],
              self.acf_lag_,
              self.acf_min_values,
          )
          for i, tree in enumerate(trees)
      )
  
      # Collect lags and newly grown trees
      for i, (lag, tree) in enumerate(worker_rets):
          self.lags[i] = lag
          self.estimators_.append(tree)
  
      return self
  
imports: import numpy
  from joblib import Parallel, delayed
  from sklearn.base import clone
  from sklearn.ensemble._base import _partition_estimators
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils.validation import check_random_state
  from sktime.classification.base import BaseClassifier
label_desc: Use image node_id 3 for calling the RandomIntervalSpectralEnsemble obj's underlying member method code with example usage: obj._fit(X, y) and returns: self