class_docstr: Canonical Interval Forest Classifier (CIF).
  
  Implementation of the nterval based forest making use of the catch22 feature set
  on randomly selected intervals described in Middlehurst et al. (2020). [1]_
  
  Overview: Input "n" series with "d" dimensions of length "m".
  For each tree
      - Sample n_intervals intervals 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, 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 or None, default=None
      Number of intervals to extract per tree, if None extracts
      (sqrt(series_length) * sqrt(n_dims)) intervals.
  att_subsample_size : int, default=8
      Number of catch22 or summary statistic attributes to subsample per tree.
  min_interval : int, default=3
      Minimum length of an interval.
  max_interval : int or None, default=None
      Maximum length of an interval, if None set to (series_length / 2).
  base_estimator : BaseEstimator or str, default="DTC"
      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.
      "CIT" uses the sktime ContinuousIntervalTree, an implementation of the original
      tree used with embedded attribute processing for faster predictions.
  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.
  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 (n_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 (n_intervals)
      The dimension to extract attributes from each interval for all classifiers.
  
  See Also
  --------
  DrCIF
  
  Notes
  -----
  For the Java version, see
  `TSML <https://github.com/uea-machine-learning/tsml/blob/master/src/main/java
  /tsml/classifiers/interval_based/CIF.java>`_.
  
  References
  ----------
  .. [1] Matthew Middlehurst and James Large and Anthony Bagnall. "The Canonical
     Interval Forest (CIF) Classifier for Time Series Classification."
     IEEE International Conference on Big Data 2020
  
  Examples
  --------
  >>> from sktime.classification.interval_based import CanonicalIntervalForest
  >>> 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 = CanonicalIntervalForest(
  ...     n_estimators=3, n_intervals=2, att_subsample_size=2
  ... ) # doctest: +SKIP
  >>> clf.fit(X_train, y_train) # doctest: +SKIP
  CanonicalIntervalForest(...)
  >>> y_pred = clf.predict(X_test) # doctest: +SKIP
class_docstr_tok: ["Canonical","Interval","Forest","Classifier","(","CIF",")",".","Implementation","of","the","nterval","based","forest","making","use","of","the","catch22","feature","set","on","randomly","selected","intervals","described","in","Middlehurst","et","al",".","(","2020",")",".","[","1","]","_","Overview",":","Input","``","n","''","series","with","``","d","''","dimensions","of","length","``","m","''",".","For","each","tree","-","Sample","n_intervals","intervals","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",",","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","or","None",",","default=None","Number","of","intervals","to","extract","per","tree",",","if","None","extracts","(","sqrt","(","series_length",")","*","sqrt","(","n_dims",")",")","intervals",".","att_subsample_size",":","int",",","default=8","Number","of","catch22","or","summary","statistic","attributes","to","subsample","per","tree",".","min_interval",":","int",",","default=3","Minimum","length","of","an","interval",".","max_interval",":","int","or","None",",","default=None","Maximum","length","of","an","interval",",","if","None","set","to","(","series_length","\/","2",")",".","base_estimator",":","BaseEstimator","or","str",",","default=","''","DTC","''","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",".","``","CIT","''","uses","the","sktime","ContinuousIntervalTree",",","an","implementation","of","the","original","tree","used","with","embedded","attribute","processing","for","faster","predictions",".","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",".","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","(","n_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","(","n_intervals",")","The","dimension","to","extract","attributes","from","each","interval","for","all","classifiers",".","See","Also","--","--","--","--","DrCIF","Notes","--","--","-","For","the","Java","version",",","see","`","TSML","<","https",":","\/\/github.com\/uea-machine-learning\/tsml\/blob\/master\/src\/main\/java","\/tsml\/classifiers\/interval_based\/CIF.java",">","`","_",".","References","--","--","--","--","--","..","[","1","]","Matthew","Middlehurst","and","James","Large","and","Anthony","Bagnall",".","``","The","Canonical","Interval","Forest","(","CIF",")","Classifier","for","Time","Series","Classification",".","''","IEEE","International","Conference","on","Big","Data","2020","Examples","--","--","--","--",">",">",">","from","sktime.classification.interval_based","import","CanonicalIntervalForest",">",">",">","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","=","CanonicalIntervalForest","(","...","n_estimators=3",",","n_intervals=2",",","att_subsample_size=2","...",")","#","doctest",":","+SKIP",">",">",">","clf.fit","(","X_train",",","y_train",")","#","doctest",":","+SKIP","CanonicalIntervalForest","(","...",")",">",">",">","y_pred","=","clf.predict","(","X_test",")","#","doctest",":","+SKIP"]
code: def _temporal_importance_curves(self, normalise_time_points=False):
      if not isinstance(self._base_estimator, ContinuousIntervalTree):
          raise ValueError(
              "CIF base estimator for temporal importance curves must"
              " be ContinuousIntervalTree."
          )
  
      curves = np.zeros((25, self.n_dims_, self.series_length_))
      if normalise_time_points:
          counts = np.zeros((25, self.n_dims_, self.series_length_))
  
      for i, tree in enumerate(self.estimators_):
          splits, gains = tree.tree_node_splits_and_gain()
  
          for n, split in enumerate(splits):
              gain = gains[n]
              interval = int(split / self._att_subsample_size)
              att = self.atts_[i][int(split % self._att_subsample_size)]
              dim = self.dims_[i][interval]
  
              for j in range(
                  self.intervals_[i][interval][0],
                  self.intervals_[i][interval][1] + 1,
              ):
                  curves[att][dim][j] += gain
                  if normalise_time_points:
                      counts[att][dim][j] += 1
  
      if normalise_time_points:
          counts = counts / self.n_estimators / self._n_intervals
          curves /= counts
  
      return curves
  
file_path: sktime/sktime/classification/interval_based/_cif.py
imports: import math
  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
label_desc: Use image node_id 7 for calling the CanonicalIntervalForest obj's underlying member method code with example usage: obj._temporal_importance_curves(normalise_time_points) and returns: curves