class_docstr: Hierarchical Vote Collective of Transformation-based Ensembles (HIVE-COTE) V1.
  
  An ensemble of the STC, TSF, RISE and cBOSS classifiers from different feature
  representations using the CAWPE structure as described in [1]_. The default
  implementation differs from the one described in [1]_, in that the STC component
  uses the out of bag error (OOB) estimates for weights (described in [2]_) rather
  than the cross validation estimate. OOB is an order of magnitude faster and on
  average as good as CV. This means that this version of HIVE COTE is a bit faster
  than HC2, although less accurate on average.
  
  Parameters
  ----------
  stc_params : dict or None, default=None
      Parameters for the ShapeletTransformClassifier module. If None, uses the
      default parameters with a 2 hour transform contract.
  tsf_params : dict or None, default=None
      Parameters for the TimeSeriesForestClassifier module. If None, uses the default
      parameters with n_estimators set to 500.
  rise_params : dict or None, default=None
      Parameters for the RandomIntervalSpectralForest module. If None, uses the
      default parameters with n_estimators set to 500.
  cboss_params : dict or None, default=None
      Parameters for the ContractableBOSS module. If None, uses the default
      parameters.
  verbose : int, default=0
      Level of output printed to the console (for information only).
  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.
  classes_ : list
      The unique class labels.
  stc_weight_ : float
      The weight for STC probabilities.
  tsf_weight_ : float
      The weight for TSF probabilities.
  rise_weight_ : float
      The weight for RISE probabilities.
  cboss_weight_ : float
      The weight for cBOSS probabilities.
  
  See Also
  --------
  HIVECOTEV2, ShapeletTransformClassifier, TimeSeriesForestClassifier,
  RandomIntervalSpectralForest, ContractableBOSS
  
  Notes
  -----
  For the Java version, see
  `https://github.com/uea-machine-learning/tsml/blob/master/src/main/java/
  tsml/classifiers/hybrids/HIVE_COTE.java`_.
  
  References
  ----------
  .. [1] Anthony Bagnall, Michael Flynn, James Large, Jason Lines and
     Matthew Middlehurst. "On the usage and performance of the Hierarchical Vote
     Collective of Transformation-based Ensembles version 1.0 (hive-cote v1.0)"
     International Workshop on Advanced Analytics and Learning on Temporal Data 2020
  .. [2] 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." Machine Learning (2021).
docstr: Fit HIVE-COTE 1.0 to training data.
  
  Parameters
  ----------
  X : 3D np.array of shape = [n_instances, n_dimensions, series_length]
      The training data.
  y : array-like, shape = [n_instances]
      The class labels.
  
  Returns
  -------
  self :
      Reference to self.
  
  Notes
  -----
  Changes state by creating a fitted model that updates attributes
  ending in "_" and sets is_fitted flag to True.
docstr_tok: ["Fit","HIVE-COTE","1.0","to","training","data",".","Parameters","--","--","--","--","--","X",":","3D","np.array","of","shape","=","[","n_instances",",","n_dimensions",",","series_length","]","The","training","data",".","y",":","array-like",",","shape","=","[","n_instances","]","The","class","labels",".","Returns","--","--","--","-","self",":","Reference","to","self",".","Notes","--","--","-","Changes","state","by","creating","a","fitted","model","that","updates","attributes","ending","in","``","_","''","and","sets","is_fitted","flag","to","True","."]
code: def _fit(self, X, y):
      """Fit HIVE-COTE 1.0 to training data.
  
      Parameters
      ----------
      X : 3D np.array of shape = [n_instances, n_dimensions, series_length]
          The training data.
      y : array-like, shape = [n_instances]
          The class labels.
  
      Returns
      -------
      self :
          Reference to self.
  
      Notes
      -----
      Changes state by creating a fitted model that updates attributes
      ending in "_" and sets is_fitted flag to True.
      """
      # Default values from HC1 paper
      if self.stc_params is None:
          self._stc_params = {"transform_limit_in_minutes": 120}
      if self.tsf_params is None:
          self._tsf_params = {"n_estimators": 500}
      if self.rise_params is None:
          self._rise_params = {"n_estimators": 500}
      if self.cboss_params is None:
          self._cboss_params = {}
  
      # Cross-validation size for TSF and RISE
      cv_size = 10
      _, counts = np.unique(y, return_counts=True)
      min_class = np.min(counts)
      if min_class < cv_size:
          cv_size = min_class
  
      # Build STC
      self._stc = ShapeletTransformClassifier(
          **self._stc_params,
          save_transformed_data=True,
          random_state=self.random_state,
          n_jobs=self._threads_to_use,
      )
      self._stc.fit(X, y)
  
      if self.verbose > 0:
          print(
              "STC ", datetime.now().strftime("%H:%M:%S %d/%m/%Y")
          )  # noqa
  
      # Find STC weight using train set estimate
      train_probs = self._stc._get_train_probs(X, y)
      train_preds = self._stc.classes_[np.argmax(train_probs, axis=1)]
      self.stc_weight_ = accuracy_score(y, train_preds) ** 4
  
      if self.verbose > 0:
          print(  # noqa
              "STC train estimate ",
              datetime.now().strftime("%H:%M:%S %d/%m/%Y"),
          )
          print("STC weight = " + str(self.stc_weight_))  # noqa
  
      # Build TSF
      self._tsf = TimeSeriesForestClassifier(
          **self._tsf_params,
          random_state=self.random_state,
          n_jobs=self._threads_to_use,
      )
      self._tsf.fit(X, y)
  
      if self.verbose > 0:
          print(
              "TSF ", datetime.now().strftime("%H:%M:%S %d/%m/%Y")
          )  # noqa
  
      # Find TSF weight using train set estimate found through CV
      train_preds = cross_val_predict(
          TimeSeriesForestClassifier(
              **self._tsf_params, random_state=self.random_state
          ),
          X=X,
          y=y,
          cv=cv_size,
          n_jobs=self._threads_to_use,
      )
      self.tsf_weight_ = accuracy_score(y, train_preds) ** 4
  
      if self.verbose > 0:
          print(  # noqa
              "TSF train estimate ",
              datetime.now().strftime("%H:%M:%S %d/%m/%Y"),
          )
          print("TSF weight = " + str(self.tsf_weight_))  # noqa
  
      # Build RISE
      self._rise = RandomIntervalSpectralEnsemble(
          **self._rise_params,
          random_state=self.random_state,
          n_jobs=self._threads_to_use,
      )
      self._rise.fit(X, y)
  
      if self.verbose > 0:
          print(
              "RISE ", datetime.now().strftime("%H:%M:%S %d/%m/%Y")
          )  # noqa
  
      # Find RISE weight using train set estimate found through CV
      train_preds = cross_val_predict(
          RandomIntervalSpectralEnsemble(
              **self._rise_params,
              random_state=self.random_state,
          ),
          X=X,
          y=y,
          cv=cv_size,
          n_jobs=self._threads_to_use,
      )
      self.rise_weight_ = accuracy_score(y, train_preds) ** 4
  
      if self.verbose > 0:
          print(  # noqa
              "RISE train estimate ",
              datetime.now().strftime("%H:%M:%S %d/%m/%Y"),
          )
          print("RISE weight = " + str(self.rise_weight_))  # noqa
  
      # Build cBOSS
      self._cboss = ContractableBOSS(
          **self._cboss_params,
          random_state=self.random_state,
          n_jobs=self._threads_to_use,
      )
      self._cboss.fit(X, y)
  
      # Find cBOSS weight using train set estimate
      train_probs = self._cboss._get_train_probs(X, y)
      train_preds = self._cboss.classes_[np.argmax(train_probs, axis=1)]
      self.cboss_weight_ = accuracy_score(y, train_preds) ** 4
  
      if self.verbose > 0:
          print(  # noqa
              "cBOSS (estimate included)",
              datetime.now().strftime("%H:%M:%S %d/%m/%Y"),
          )
          print("cBOSS weight = " + str(self.cboss_weight_))  # noqa
  
      return self
  
file_path: sktime/sktime/classification/hybrid/_hivecote_v1.py
imports: from datetime import datetime
  import numpy
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import cross_val_predict
  from sklearn.utils import check_random_state
  from sktime.classification.base import BaseClassifier
  from sktime.classification.dictionary_based import ContractableBOSS
  from sktime.classification.interval_based import RandomIntervalSpectralEnsemble, TimeSeriesForestClassifier
  from sktime.classification.shapelet_based import ShapeletTransformClassifier
label_desc: Use image node_id 2 for calling the HIVECOTEV1 obj's underlying member method code with example usage: obj._fit(X, y) and returns: self