class_docstr: Shapelet Transform.
  
  Original journal publication:
  @article{hills2014classification,
    title={Classification of time series by shapelet transformation},
    author={Hills, Jon and Lines, Jason and Baranauskas, Edgaras and Mapp,
    James and Bagnall, Anthony},
    journal={Data Mining and Knowledge Discovery},
    volume={28},
    number={4},
    pages={851--881},
    year={2014},
    publisher={Springer}
  }
  
  Parameters
  ----------
  min_shapelet_length                 : int, lower bound on candidate
  shapelet lengths (default = 3)
  max_shapelet_length                 : int, upper bound on candidate
  shapelet lengths (default = inf or series length)
  max_shapelets_to_store_per_class    : int, upper bound on number of
  shapelets to retain from each distinct class (default = 200)
  random_state                        : RandomState, int, or none: to
  control random state objects for deterministic results (default = None)
  verbose                             : int, level of output printed to
  the console (for information only) (default = 0)
  remove_self_similar                 : boolean, remove overlapping
  "self-similar" shapelets from the final transform (default = True)
  
  Attributes
  ----------
  predefined_ig_rejection_level       : float, minimum information gain
  required to keep a shapelet (default = 0.05)
  self.shapelets                      : list of Shapelet objects,
  the stored shapelets after a dataset has been processed
docstr: Transform X according to the extracted shapelets (self.shapelets).
  
  Parameters
  ----------
  X : pandas DataFrame
      The input dataframe to transform
  
  Returns
  -------
  output : pandas DataFrame
      The transformed dataframe in tabular format.
docstr_tok: ["Transform","X","according","to","the","extracted","shapelets","(","self.shapelets",")",".","Parameters","--","--","--","--","--","X",":","pandas","DataFrame","The","input","dataframe","to","transform","Returns","--","--","--","-","output",":","pandas","DataFrame","The","transformed","dataframe","in","tabular","format","."]
code: def _transform(self, X, y=None):
      """Transform X according to the extracted shapelets (self.shapelets).
  
      Parameters
      ----------
      X : pandas DataFrame
          The input dataframe to transform
  
      Returns
      -------
      output : pandas DataFrame
          The transformed dataframe in tabular format.
      """
      if len(self.shapelets) == 0:
          raise RuntimeError(
              "No shapelets were extracted in fit that exceeded the "
              "minimum information gain threshold. Please retry with other "
              "data and/or parameter settings."
          )
  
      # may need to pad with nans here for uneq length, look at later
      output = np.zeros(
          [len(X), len(self.shapelets)],
          dtype=np.float32,
      )
  
      # for the i^th series to transform
      for i in range(0, len(X)):
          this_series = X[i]
  
          # get the s^th shapelet
          for s in range(0, len(self.shapelets)):
              # find distance between this series and each shapelet
              min_dist = np.inf
              this_shapelet_length = self.shapelets[s].length
  
              for start_pos in range(
                  0, len(this_series[0]) - this_shapelet_length + 1
              ):
                  comparison = ShapeletTransform.zscore(
                      this_series[
                          :,
                          start_pos : (
                              start_pos + this_shapelet_length
                          ),
                      ]
                  )
  
                  dist = np.linalg.norm(
                      self.shapelets[s].data - comparison
                  )
                  dist = dist * dist
                  dist = 1.0 / this_shapelet_length * dist
                  min_dist = min(min_dist, dist)
  
                  output[i][s] = min_dist
  
      return pd.DataFrame(output)
  
imports: import heapq
  import time
  import warnings
  from itertools import zip_longest
  from operator import itemgetter
  import numpy
  import pandas
  from joblib import Parallel, delayed
  from sklearn import preprocessing
  from sklearn.utils import check_random_state
  from sklearn.utils.multiclass import class_distribution
  from sktime.transformations.base import BaseTransformer
  from sktime.utils.validation import check_n_jobs
label_desc: Use image node_id 4 for calling the ShapeletTransform obj's underlying member method code with example usage: obj._transform(X, y) and returns: pd