class_docstr: The Elastic Ensemble (EE).
  
  EE as described in [1].
  
  Overview:
  
  - Input n series length m
  - EE is an ensemble of elastic nearest neighbor classifiers
  
  Parameters
  ----------
  distance_measures : list of strings, optional (default="all")
    A list of strings identifying which distance measures to include. Valid values
    are one or more of: euclidean, dtw, wdtw, ddtw, dwdtw, lcss, erp, msm
  proportion_of_param_options : float, optional (default=1)
    The proportion of the parameter grid space to search optional.
  proportion_train_in_param_finding : float, optional (default=1)
    The proportion of the train set to use in the parameter search optional.
  proportion_train_for_test : float, optional (default=1)
    The proportion of the train set to use in classifying new cases optional.
  n_jobs : int, optional (default=1)
    The number of jobs to run in parallel for both `fit` and `predict`.
    ``-1`` means using all processors.
  random_state : int, default=0
    The random seed.
  verbose : int, default=0
    If ``>0``, then prints out debug information.
  
  Attributes
  ----------
  estimators_ : list
    A list storing all classifiers
  train_accs_by_classifier : ndarray
    Store the train accuracies of the classifiers
  
  Notes
  -----
  ..[1] Jason Lines and Anthony Bagnall,
        "Time Series Classification with Ensembles of Elastic Distance Measures",
            Data Mining and Knowledge Discovery, 29(3), 2015.
  https://link.springer.com/article/10.1007/s10618-014-0361-2
  
  Examples
  --------
  >>> from sktime.classification.distance_based import ElasticEnsemble
  >>> from sktime.datasets import load_unit_test  # doctest: +SKIP
  >>> X_train, y_train = load_unit_test(split="train")  # doctest: +SKIP
  >>> X_test, y_test = load_unit_test(split="test")  # doctest: +SKIP
  >>> clf = ElasticEnsemble(
  ...     proportion_of_param_options=0.1,
  ...     proportion_train_for_test=0.1,
  ...     distance_measures = ["dtw","ddtw"],
  ...     majority_vote=True,
  ... )  # doctest: +SKIP
  >>> clf.fit(X_train, y_train)  # doctest: +SKIP
  ElasticEnsemble(...)
  >>> y_pred = clf.predict(X_test)  # doctest: +SKIP
class_docstr_tok: ["The","Elastic","Ensemble","(","EE",")",".","EE","as","described","in","[","1","]",".","Overview",":","-","Input","n","series","length","m","-","EE","is","an","ensemble","of","elastic","nearest","neighbor","classifiers","Parameters","--","--","--","--","--","distance_measures",":","list","of","strings",",","optional","(","default=","''","all","''",")","A","list","of","strings","identifying","which","distance","measures","to","include",".","Valid","values","are","one","or","more","of",":","euclidean",",","dtw",",","wdtw",",","ddtw",",","dwdtw",",","lcss",",","erp",",","msm","proportion_of_param_options",":","float",",","optional","(","default=1",")","The","proportion","of","the","parameter","grid","space","to","search","optional",".","proportion_train_in_param_finding",":","float",",","optional","(","default=1",")","The","proportion","of","the","train","set","to","use","in","the","parameter","search","optional",".","proportion_train_for_test",":","float",",","optional","(","default=1",")","The","proportion","of","the","train","set","to","use","in","classifying","new","cases","optional",".","n_jobs",":","int",",","optional","(","default=1",")","The","number","of","jobs","to","run","in","parallel","for","both","`","fit","`","and","`","predict","`",".","``","-1","``","means","using","all","processors",".","random_state",":","int",",","default=0","The","random","seed",".","verbose",":","int",",","default=0","If","``",">","0","``",",","then","prints","out","debug","information",".","Attributes","--","--","--","--","--","estimators_",":","list","A","list","storing","all","classifiers","train_accs_by_classifier",":","ndarray","Store","the","train","accuracies","of","the","classifiers","Notes","--","--","-","..","[","1","]","Jason","Lines","and","Anthony","Bagnall",",","``","Time","Series","Classification","with","Ensembles","of","Elastic","Distance","Measures","''",",","Data","Mining","and","Knowledge","Discovery",",","29","(","3",")",",","2015.","https",":","\/\/link.springer.com\/article\/10.1007\/s10618-014-0361-2","Examples","--","--","--","--",">",">",">","from","sktime.classification.distance_based","import","ElasticEnsemble",">",">",">","from","sktime.datasets","import","load_unit_test","#","doctest",":","+SKIP",">",">",">","X_train",",","y_train","=","load_unit_test","(","split=","''","train","''",")","#","doctest",":","+SKIP",">",">",">","X_test",",","y_test","=","load_unit_test","(","split=","''","test","''",")","#","doctest",":","+SKIP",">",">",">","clf","=","ElasticEnsemble","(","...","proportion_of_param_options=0.1",",","...","proportion_train_for_test=0.1",",","...","distance_measures","=","[","``","dtw","''",",","''","ddtw","''","]",",","...","majority_vote=True",",","...",")","#","doctest",":","+SKIP",">",">",">","clf.fit","(","X_train",",","y_train",")","#","doctest",":","+SKIP","ElasticEnsemble","(","...",")",">",">",">","y_pred","=","clf.predict","(","X_test",")","#","doctest",":","+SKIP"]
docstr: Predict class probabilities for n instances in X.
  
  Parameters
  ----------
  X : pd.DataFrame of shape [n, 1]
  
  Returns
  -------
  array of shape [n, self.n_classes]
docstr_tok: ["Predict","class","probabilities","for","n","instances","in","X.","Parameters","--","--","--","--","--","X",":","pd.DataFrame","of","shape","[","n",",","1","]","Returns","--","--","--","-","array","of","shape","[","n",",","self.n_classes","]"]
code: def _predict_proba(self, X) -> np.ndarray:
      """Predict class probabilities for n instances in X.
  
      Parameters
      ----------
      X : pd.DataFrame of shape [n, 1]
  
      Returns
      -------
      array of shape [n, self.n_classes]
      """
      # Derivative DTW (DDTW) uses the regular DTW algorithm on data that
      # are transformed into derivatives.
      # To increase the efficiency of DDTW we can pre-transform the data
      # into derivatives, and then call the
      # standard DTW algorithm on it, rather than transforming each series
      # every time a distance calculation
      # is made. Please note that using DDTW elsewhere will not benefit
      # from this speed enhancement
      if self.distance_measures.__contains__(
          "ddtw"
      ) or self.distance_measures.__contains__("wddtw"):
          der_X = DerivativeSlopeTransformer().fit_transform(X)
          if isinstance(X, pd.DataFrame):
              der_X = np.array(
                  [
                      np.asarray([x]).reshape(1, len(x))
                      for x in der_X.iloc[:, 0]
                  ]
              )
      else:
          der_X = None
  
      # reshape X for use with the efficient cython distance measures
      if isinstance(X, pd.DataFrame):
          X = np.array(
              [np.asarray([x]).reshape(1, len(x)) for x in X.iloc[:, 0]]
          )
  
      output_probas = []
      train_sum = 0
  
      for c in range(0, len(self.estimators_)):
          if (
              self.distance_measures[c] == "ddtw"
              or self.distance_measures[c] == "wddtw"
          ):
              test_X_to_use = der_X
          else:
              test_X_to_use = X
          this_train_acc = self.train_accs_by_classifier[c]
          this_probas = np.multiply(
              self.estimators_[c].predict_proba(test_X_to_use),
              this_train_acc,
          )
          output_probas.append(this_probas)
          train_sum += this_train_acc
  
      output_probas = np.sum(output_probas, axis=0)
      output_probas = np.divide(output_probas, train_sum)
      return output_probas
  
file_path: sktime/sktime/classification/distance_based/_elastic_ensemble.py
imports: import time
  from itertools import product
  import numpy
  import pandas
  from sklearn.metrics import accuracy_score
  from sklearn.model_selection import GridSearchCV, LeaveOneOut, RandomizedSearchCV, StratifiedShuffleSplit, cross_val_predict
  from sktime.classification.base import BaseClassifier
  from sktime.classification.distance_based._time_series_neighbors import KNeighborsTimeSeriesClassifier
  from sktime.datatypes._panel._convert import from_nested_to_3d_numpy
  from sktime.transformations.panel.summarize import DerivativeSlopeTransformer
label_desc: Use image node_id 3 for calling the ElasticEnsemble obj's underlying member method code with example usage: obj._predict_proba(X) and returns: output_probas