class_docstr: Pipeline of transformers and a pairwise panel transformer.
  
  `PwTrafoPanelPipeline` chains transformers and a pairwise transformer at the end.
  The pipeline is constructed with a list of sktime transformers (BaseTransformer),
      plus a pairwise panel transformer, following BasePairwiseTransformerPanel.
  The transformer list can be unnamed - a simple list of transformers -
      or string named - a list of pairs of string, estimator.
  
  For a list of transformers `trafo1`, `trafo2`, ..., `trafoN` and an estimator `est`,
      the pipeline behaves as follows:
  `transform(X)` - running `trafo1.fit_transform` on `X`,
      them `trafo2.fit_transform` on the output of `trafo1.fit_transform`, etc
      sequentially, with `trafo[i]` receiving the output of `trafo[i-1]`.
      Then passes output of `trafo[N]` to `pw_trafo.transform`, as `X`.
      Same chain of transformers is run on `X2` and passed, if not `None`.
  
  `PwTrafoPanelPipeline` can also be created by using the magic multiplication
      on any parameter estimator: if `pw_t` is `BasePairwiseTransformerPanel`,
          and `my_trafo1`, `my_trafo2` inherit from `BaseTransformer`, then,
          for instance, `my_trafo1 * my_trafo2 * pw_t`
          will result in the same object as  obtained from the constructor
          `PwTrafoPanelPipeline(pw_trafo=pw_t, transformers=[my_trafo1, my_trafo2])`
      magic multiplication can also be used with (str, transformer) pairs,
          as long as one element in the chain is a transformer
  
  Parameters
  ----------
  pw_trafo : pairwise panel transformer,
      i.e., estimator inheriting from BasePairwiseTransformerPanel
      this is a "blueprint" estimator, state does not change when `fit` is called
  transformers : list of sktime transformers, or
      list of tuples (str, transformer) of sktime transformers
      these are "blueprint" transformers, states do not change when `fit` is called
  
  Examples
  --------
  >>> from sktime.dists_kernels.compose import PwTrafoPanelPipeline
  >>> from sktime.dists_kernels.dtw import DtwDist
  >>> from sktime.transformations.series.exponent import ExponentTransformer
  >>> from sktime.datasets import load_unit_test
  >>>
  >>> X, _ = load_unit_test()
  >>> X = X[0:3]
  >>> pipeline = PwTrafoPanelPipeline(DtwDist(), [ExponentTransformer()])
  >>> dist_mat = pipeline.transform(X)
class_docstr_tok: ["Pipeline","of","transformers","and","a","pairwise","panel","transformer",".","`","PwTrafoPanelPipeline","`","chains","transformers","and","a","pairwise","transformer","at","the","end",".","The","pipeline","is","constructed","with","a","list","of","sktime","transformers","(","BaseTransformer",")",",","plus","a","pairwise","panel","transformer",",","following","BasePairwiseTransformerPanel",".","The","transformer","list","can","be","unnamed","-","a","simple","list","of","transformers","-","or","string","named","-","a","list","of","pairs","of","string",",","estimator",".","For","a","list","of","transformers","`","trafo1","`",",","`","trafo2","`",",","...",",","`","trafoN","`","and","an","estimator","`","est","`",",","the","pipeline","behaves","as","follows",":","`","transform","(","X",")","`","-","running","`","trafo1.fit_transform","`","on","`","X","`",",","them","`","trafo2.fit_transform","`","on","the","output","of","`","trafo1.fit_transform","`",",","etc","sequentially",",","with","`","trafo","[","i","]","`","receiving","the","output","of","`","trafo","[","i-1","]","`",".","Then","passes","output","of","`","trafo","[","N","]","`","to","`","pw_trafo.transform","`",",","as","`","X","`",".","Same","chain","of","transformers","is","run","on","`","X2","`","and","passed",",","if","not","`","None","`",".","`","PwTrafoPanelPipeline","`","can","also","be","created","by","using","the","magic","multiplication","on","any","parameter","estimator",":","if","`","pw_t","`","is","`","BasePairwiseTransformerPanel","`",",","and","`","my_trafo1","`",",","`","my_trafo2","`","inherit","from","`","BaseTransformer","`",",","then",",","for","instance",",","`","my_trafo1","*","my_trafo2","*","pw_t","`","will","result","in","the","same","object","as","obtained","from","the","constructor","`","PwTrafoPanelPipeline","(","pw_trafo=pw_t",",","transformers=","[","my_trafo1",",","my_trafo2","]",")","`","magic","multiplication","can","also","be","used","with","(","str",",","transformer",")","pairs",",","as","long","as","one","element","in","the","chain","is","a","transformer","Parameters","--","--","--","--","--","pw_trafo",":","pairwise","panel","transformer",",","i.e.",",","estimator","inheriting","from","BasePairwiseTransformerPanel","this","is","a","``","blueprint","''","estimator",",","state","does","not","change","when","`","fit","`","is","called","transformers",":","list","of","sktime","transformers",",","or","list","of","tuples","(","str",",","transformer",")","of","sktime","transformers","these","are","``","blueprint","''","transformers",",","states","do","not","change","when","`","fit","`","is","called","Examples","--","--","--","--",">",">",">","from","sktime.dists_kernels.compose","import","PwTrafoPanelPipeline",">",">",">","from","sktime.dists_kernels.dtw","import","DtwDist",">",">",">","from","sktime.transformations.series.exponent","import","ExponentTransformer",">",">",">","from","sktime.datasets","import","load_unit_test",">",">",">",">",">",">","X",",","_","=","load_unit_test","(",")",">",">",">","X","=","X","[","0:3","]",">",">",">","pipeline","=","PwTrafoPanelPipeline","(","DtwDist","(",")",",","[","ExponentTransformer","(",")","]",")",">",">",">","dist_mat","=","pipeline.transform","(","X",")"]
docstr: Compute distance/kernel matrix.
  
  private _transform containing core logic, called from public transform
  
  Behaviour: returns pairwise distance/kernel matrix
      between samples in X and X2
          if X2 is not passed, is equal to X
          if X/X2 is a pd.DataFrame and contains non-numeric columns,
              these are removed before computation
  
  Parameters
  ----------
  X: sktime Panel data container
  X2: sktime Panel data container
  
  Returns
  -------
  distmat: np.array of shape [n, m]
      (i,j)-th entry contains distance/kernel between X.iloc[i] and X2.iloc[j]
docstr_tok: ["Compute","distance\/kernel","matrix",".","private","_transform","containing","core","logic",",","called","from","public","transform","Behaviour",":","returns","pairwise","distance\/kernel","matrix","between","samples","in","X","and","X2","if","X2","is","not","passed",",","is","equal","to","X","if","X\/X2","is","a","pd.DataFrame","and","contains","non-numeric","columns",",","these","are","removed","before","computation","Parameters","--","--","--","--","--","X",":","sktime","Panel","data","container","X2",":","sktime","Panel","data","container","Returns","--","--","--","-","distmat",":","np.array","of","shape","[","n",",","m","]","(","i",",","j",")","-th","entry","contains","distance\/kernel","between","X.iloc","[","i","]","and","X2.iloc","[","j","]"]
code: def _transform(self, X, X2=None):
      """Compute distance/kernel matrix.
  
      private _transform containing core logic, called from public transform
  
      Behaviour: returns pairwise distance/kernel matrix
          between samples in X and X2
              if X2 is not passed, is equal to X
              if X/X2 is a pd.DataFrame and contains non-numeric columns,
                  these are removed before computation
  
      Parameters
      ----------
      X: sktime Panel data container
      X2: sktime Panel data container
  
      Returns
      -------
      distmat: np.array of shape [n, m]
          (i,j)-th entry contains distance/kernel between X.iloc[i] and X2.iloc[j]
      """
      trafos = self.transformers_.clone()
      pw_trafo = self.pw_trafo
  
      Xt = trafos.fit_transform(X)
  
      # find out whether we know that the resulting matrix is symmetric
      #   since aligner distances are always symmetric,
      #   we know it's the case for sure if X equals X2
      if X2 is None:
          X2t = None
      else:
          X2t = trafos.fit_transform(X2)
  
      distmat = pw_trafo.transform(Xt, X2t)
      return distmat
  
file_path: sktime/sktime/dists_kernels/compose.py
imports: from sktime.base import _HeterogenousMetaEstimator
  from sktime.dists_kernels.base import BasePairwiseTransformerPanel
  from sktime.transformations.base import BaseTransformer
  from sktime.transformations.compose import TransformerPipeline
label_desc: Use image node_id 5 for calling the PwTrafoPanelPipeline obj's underlying member method code with example usage: obj._transform(X, X2) and returns: distmat