class_docstr: Diverse Representation Canonical Interval Forest Classifier (DrCIF).
  
  Extension of the CIF algorithm using multiple representations. Implementation of the
  interval based forest making use of the catch22 feature set on randomly selected
  intervals on the base series, periodogram representation and differences
  representation described in the HIVE-COTE 2.0 paper Middlehurst et al (2021). [1]_
  
  Overview: Input "n" series with "d" dimensions of length "m".
  For each tree
      - Sample n_intervals intervals per representation of random position and length
      - Subsample att_subsample_size catch22 or summary statistic attributes randomly
      - Randomly select dimension for each interval
      - Calculate attributes for each interval from its representation, concatenate
        to form new data set
      - Build decision tree on new data set
  Ensemble the trees with averaged probability estimates
  
  Parameters
  ----------
  n_estimators : int, default=200
      Number of estimators to build for the ensemble.
  n_intervals : int, length 3 list of int or None, default=None
      Number of intervals to extract per representation per tree as an int for all
      representations or list for individual settings, if None extracts
      (4 + (sqrt(representation_length) * sqrt(n_dims)) / 3) intervals.
  att_subsample_size : int, default=10
      Number of catch22 or summary statistic attributes to subsample per tree.
  min_interval : int or length 3 list of int, default=4
      Minimum length of an interval per representation as an int for all
      representations or list for individual settings.
  max_interval : int, length 3 list of int or None, default=None
      Maximum length of an interval per representation as an int for all
      representations or list for individual settings, if None set to
      (representation_length / 2).
  base_estimator : BaseEstimator or str, default="CIT"
      Base estimator for the ensemble, can be supplied a sklearn BaseEstimator or a
      string for suggested options.
      "DTC" uses the sklearn DecisionTreeClassifier using entropy as a splitting
      measure (sklearn.tree.DecisionTreeClassifier).
      "CIT" uses the sktime ContinuousIntervalTree, an implementation of the original
      tree used with embedded attribute processing for faster predictions
      (sktime.classification.interval_based.ContinuousIntervalTree).
      In order to pass parameters to estimators, pass a BaseEstimator instance.
  time_limit_in_minutes : int, default=0
      Time contract to limit build time in minutes, overriding n_estimators.
      Default of 0 means n_estimators is used.
  contract_max_n_estimators : int, default=500
      Max number of estimators when time_limit_in_minutes is set.
  save_transformed_data : bool, default=False
      Save the data transformed in fit for use in _get_train_probs.
  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 number generation.
  
  Attributes
  ----------
  n_classes_ : int
      The number of classes.
  n_instances_ : int
      The number of train cases.
  n_dims_ : int
      The number of dimensions per case.
  series_length_ : int
      The length of each series.
  classes_ : list
      The classes labels.
  total_intervals_ : int
      Total number of intervals per tree from all representations.
  estimators_ : list of shape (n_estimators) of BaseEstimator
      The collections of estimators trained in fit.
  intervals_ : list of shape (n_estimators) of ndarray with shape (total_intervals,2)
      Stores indexes of each intervals start and end points for all classifiers.
  atts_ : list of shape (n_estimators) of array with shape (att_subsample_size)
      Attribute indexes of the subsampled catch22 or summary statistic for all
      classifiers.
  dims_ : list of shape (n_estimators) of array with shape (total_intervals)
      The dimension to extract attributes from each interval for all classifiers.
  transformed_data_ : list of shape (n_estimators) of ndarray with shape
  (n_instances,total_intervals * att_subsample_size)
      The transformed dataset for all classifiers. Only saved when
      save_transformed_data is true.
  
  See Also
  --------
  CanonicalIntervalForest
  
  Notes
  -----
  For the Java version, see
  `TSML <https://github.com/uea-machine-learning/tsml/blob/master/src/main/java
  /tsml/classifiers/interval_based/DrCIF.java>`_.
  
  References
  ----------
  .. [1] Middlehurst, Matthew, James Large, Michael Flynn, Jason Lines, Aaron Bostrom,
     and Anthony Bagnall. "HIVE-COTE 2.0: a new meta ensemble for time series
     classification." arXiv preprint arXiv:2104.07551 (2021).
  
  Examples
  --------
  >>> from sktime.classification.interval_based import DrCIF
  >>> from sktime.datasets import load_unit_test
  >>> X_train, y_train = load_unit_test(split="train", return_X_y=True)
  >>> X_test, y_test = load_unit_test(split="test", return_X_y=True) # doctest: +SKIP
  >>> clf = DrCIF(
  ...     n_estimators=3, n_intervals=2, att_subsample_size=2
  ... ) # doctest: +SKIP
  >>> clf.fit(X_train, y_train) # doctest: +SKIP
  DrCIF(...)
  >>> y_pred = clf.predict(X_test) # doctest: +SKIP
code: def _predict_proba(self, X) -> np.ndarray:
      n_test_instances, _, series_length = X.shape
      if series_length != self.series_length_:
          raise ValueError(
              "ERROR number of attributes in the train does not match "
              "that in the test data"
          )
  
      X_p = np.zeros(
          (
              n_test_instances,
              self.n_dims_,
              int(
                  math.pow(
                      2, math.ceil(math.log(self.series_length_, 2))
                  )
                  - self.series_length_
              ),
          )
      )
      X_p = np.concatenate((X, X_p), axis=2)
      X_p = np.abs(np.fft.fft(X_p)[:, :, : int(X_p.shape[2] / 2)])
  
      X_d = np.diff(X, 1)
  
      y_probas = Parallel(n_jobs=self._threads_to_use)(
          delayed(self._predict_proba_for_estimator)(
              X,
              X_p,
              X_d,
              self.estimators_[i],
              self.intervals_[i],
              self.dims_[i],
              self.atts_[i],
          )
          for i in range(self._n_estimators)
      )
  
      output = np.sum(y_probas, axis=0) / (
          np.ones(self.n_classes_) * self._n_estimators
      )
      return output
  
imports: import math
  import time
  import numpy
  from joblib import Parallel, delayed
  from sklearn.base import BaseEstimator
  from sklearn.tree import DecisionTreeClassifier
  from sklearn.utils import check_random_state
  from sktime.base._base import _clone_estimator
  from sktime.classification.base import BaseClassifier
  from sktime.classification.sklearn._continuous_interval_tree import ContinuousIntervalTree
  from sktime.transformations.panel.catch22 import Catch22
  from sktime.utils.validation.panel import check_X_y
label_desc: Use image node_id 4 for calling the DrCIF obj's underlying member method code with example usage: obj._predict_proba(X) and returns: output