class_docstr: Time series signature kernel, including high-order and low-rank variants.
  
  Implements the signature kernel of Kiraly et al, see [1]_ and [2]_,
  including higher-order and low-rank approximation variants described therein.
  
  Parameters
  ----------
  kernel : sktime pairwise (tabular) transformer, callable, or None
      inner (tabular) kernel used in the signature sequence kernel
      if callable: function (2D np.ndarray x 2D np.ndarray) -> 2D np.ndarray
      pairwise kernel function, matrix sizes (n, d) x (m, d) -> (n x m)
      optional, default = None = Euclidean (linear) kernel with scale parameter 1
  level : int, optional, default = 2
      an integer >= 1, representing the level of truncation of the sequential kernel
  degree : int, optional, default = 1
      an integer >= 1, representing the order of approximation of sequential kernel
      can be set only if lowrank = False, otherwise ignored (always = 1)
  theta : float, optional, default=1.0
      a positive scaling factor for the levels, i-th level is scaled by theta^i
  normalize : bool, optional, default = False
      whether the output kernel matrix is normalized
      if True, sums and cumsums are divided by prod(K.shape)
  lowrank : bool, optional, default = False
      whether to use low rank approximation in computing the kernel
  rankbound : int, optional, default = infinity
      a hard threshold for the rank of the level matrices
      used only if lowrank = True
  
  References
  ----------
  .. [1] F. Kiraly, H. Oberhauser. 2016. "Kernels for sequentially ordered data.",
      arXiv: 1601.08169.
  .. [2] F. Kiraly, H. Oberhauser. 2019. "Kernels for sequentially ordered data.",
      Journal of Machine Learning Research.
class_docstr_tok: ["Time","series","signature","kernel",",","including","high-order","and","low-rank","variants",".","Implements","the","signature","kernel","of","Kiraly","et","al",",","see","[","1","]","_","and","[","2","]","_",",","including","higher-order","and","low-rank","approximation","variants","described","therein",".","Parameters","--","--","--","--","--","kernel",":","sktime","pairwise","(","tabular",")","transformer",",","callable",",","or","None","inner","(","tabular",")","kernel","used","in","the","signature","sequence","kernel","if","callable",":","function","(","2D","np.ndarray","x","2D","np.ndarray",")","-",">","2D","np.ndarray","pairwise","kernel","function",",","matrix","sizes","(","n",",","d",")","x","(","m",",","d",")","-",">","(","n","x","m",")","optional",",","default","=","None","=","Euclidean","(","linear",")","kernel","with","scale","parameter","1","level",":","int",",","optional",",","default","=","2","an","integer",">","=","1",",","representing","the","level","of","truncation","of","the","sequential","kernel","degree",":","int",",","optional",",","default","=","1","an","integer",">","=","1",",","representing","the","order","of","approximation","of","sequential","kernel","can","be","set","only","if","lowrank","=","False",",","otherwise","ignored","(","always","=","1",")","theta",":","float",",","optional",",","default=1.0","a","positive","scaling","factor","for","the","levels",",","i-th","level","is","scaled","by","theta^i","normalize",":","bool",",","optional",",","default","=","False","whether","the","output","kernel","matrix","is","normalized","if","True",",","sums","and","cumsums","are","divided","by","prod","(","K.shape",")","lowrank",":","bool",",","optional",",","default","=","False","whether","to","use","low","rank","approximation","in","computing","the","kernel","rankbound",":","int",",","optional",",","default","=","infinity","a","hard","threshold","for","the","rank","of","the","level","matrices","used","only","if","lowrank","=","True","References","--","--","--","--","--","..","[","1","]","F.","Kiraly",",","H.","Oberhauser",".","2016",".","``","Kernels","for","sequentially","ordered","data",".","``",",","arXiv",":","1601.08169",".","..","[","2","]","F.","Kiraly",",","H.","Oberhauser",".","2019",".","``","Kernels","for","sequentially","ordered","data",".","``",",","Journal","of","Machine","Learning","Research","."]
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: 3D np.array of shape [num_instances, num_vars, num_time_points]
  X2: 3D np.array of shape [num_instances, num_vars, num_time_points], optional
      default X2 = X
  
  Returns
  -------
  distmat: np.array of shape [n, m]
      (i,j)-th entry contains distance/kernel between X[i] and X2[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",":","3D","np.array","of","shape","[","num_instances",",","num_vars",",","num_time_points","]","X2",":","3D","np.array","of","shape","[","num_instances",",","num_vars",",","num_time_points","]",",","optional","default","X2","=","X","Returns","--","--","--","-","distmat",":","np.array","of","shape","[","n",",","m","]","(","i",",","j",")","-th","entry","contains","distance\/kernel","between","X","[","i","]","and","X2","[","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: 3D np.array of shape [num_instances, num_vars, num_time_points]
      X2: 3D np.array of shape [num_instances, num_vars, num_time_points], optional
          default X2 = X
  
      Returns
      -------
      distmat: np.array of shape [n, m]
          (i,j)-th entry contains distance/kernel between X[i] and X2[j]
      """
      kwargs = self._kern_kwargs
      kernel = self._kernel
  
      if X2 is None:
          return seq_kernel(X, kernelfun=kernel, **kwargs)
      else:
          return seq_kernel_XY(X, X2, kernelfun=kernel, **kwargs)
  
imports: import collections
  from functools import partial
  import numpy
  from scipy.sparse.linalg import svds
  from sklearn.base import BaseEstimator, TransformerMixin
  from sktime.dists_kernels.base import BasePairwiseTransformerPanel
label_desc: Use image node_id 2 for calling the SignatureKernel obj's underlying member method code with example usage: obj._transform(X, X2) and returns: seq_kernel, seq_kernel_XY