class_docstr: Compute the sequential kernel matrix row features on collection of series.
  
  Original implementation of signature kernel in [1]_ and [2]_.
  The algorithm used therein is sklearn GridSearchCV wrapping
  the sklearn pipeline of SeqKernelizer and SVC.
  
  Identical behaviour can be obtained in sktime as
  a grid search wrapped DistanceFeatures(SignatureKernel()) * SVC() pipeline
  
  Included for historical purposes only, as reference to original paper code,
  and for reproduction of the original experiments in the JMLR publication.
  Users and developers should use/modify SequentialKernel instead.
  
  This sklearn estimator requires passing of integer "numfeatures" as parameter,
  and will interpret rows of X as time series with `numfeatures` features/vars,
  and X.shape[1]/numfeatures time stamps, reshaped in (vars, time stamps) order.
  
  In transform, will transform a series to the row of the kernel matrix
  between that series and all the series seen in fit,, via seq_kernel_XY.
  
  Parameters
  ----------
  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
  kernel : str, one of "linear", "Gauss", "Laplace", "poly"
      code for inner kernel in the sequential kernel, with kernel parameters
      "linear" - Euclidean kernel with scale parameter
      "Gauss" - Gaussian kernel with scale parameter
      "Laplace" - Laplace kernel with scale parameter
      "poly" - polynomial kernel with degree deg and scale parameter
  scale : float, optional, default = 1.0
      a positive scaling factor for the inner kernel
  degree : int, optional, default = 1, used only for polynomial kernel (kernel="poly")
      degree of the polynomial kernel (if used)
  numfeatures : int, optional, default = 2
      number of features/variables in the time series
  subsample : int, optional, default = 1
      time index step size to sub-sample
  differences : bool, optional, default = True
      whether to take first temporal differences (True) or not (False)
  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: ["Compute","the","sequential","kernel","matrix","row","features","on","collection","of","series",".","Original","implementation","of","signature","kernel","in","[","1","]","_","and","[","2","]","_",".","The","algorithm","used","therein","is","sklearn","GridSearchCV","wrapping","the","sklearn","pipeline","of","SeqKernelizer","and","SVC",".","Identical","behaviour","can","be","obtained","in","sktime","as","a","grid","search","wrapped","DistanceFeatures","(","SignatureKernel","(",")",")","*","SVC","(",")","pipeline","Included","for","historical","purposes","only",",","as","reference","to","original","paper","code",",","and","for","reproduction","of","the","original","experiments","in","the","JMLR","publication",".","Users","and","developers","should","use\/modify","SequentialKernel","instead",".","This","sklearn","estimator","requires","passing","of","integer","``","numfeatures","''","as","parameter",",","and","will","interpret","rows","of","X","as","time","series","with","`","numfeatures","`","features\/vars",",","and","X.shape","[","1","]","\/numfeatures","time","stamps",",","reshaped","in","(","vars",",","time","stamps",")","order",".","In","transform",",","will","transform","a","series","to","the","row","of","the","kernel","matrix","between","that","series","and","all","the","series","seen","in","fit",",",",","via","seq_kernel_XY",".","Parameters","--","--","--","--","--","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","kernel",":","str",",","one","of","``","linear","''",",","``","Gauss","''",",","``","Laplace","''",",","``","poly","''","code","for","inner","kernel","in","the","sequential","kernel",",","with","kernel","parameters","``","linear","''","-","Euclidean","kernel","with","scale","parameter","``","Gauss","''","-","Gaussian","kernel","with","scale","parameter","``","Laplace","''","-","Laplace","kernel","with","scale","parameter","``","poly","''","-","polynomial","kernel","with","degree","deg","and","scale","parameter","scale",":","float",",","optional",",","default","=","1.0","a","positive","scaling","factor","for","the","inner","kernel","degree",":","int",",","optional",",","default","=","1",",","used","only","for","polynomial","kernel","(","kernel=","''","poly","''",")","degree","of","the","polynomial","kernel","(","if","used",")","numfeatures",":","int",",","optional",",","default","=","2","number","of","features\/variables","in","the","time","series","subsample",":","int",",","optional",",","default","=","1","time","index","step","size","to","sub-sample","differences",":","bool",",","optional",",","default","=","True","whether","to","take","first","temporal","differences","(","True",")","or","not","(","False",")","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","."]
code: def __init__(
      self,
      level=2,
      degree=1,
      theta=1,
      kernel="linear",
      scale=1,
      deg=2,
      numfeatures=2,
      subsample=100,
      differences=True,
      normalize=False,
      lowrank=False,
      rankbound=float("inf"),
  ):
      self.level = level
      self.degree = degree
      self.theta = theta
      self.kernel = kernel
      self.scale = scale
      self.deg = deg
      self.numfeatures = numfeatures
      self.subsample = subsample
      self.differences = differences
      self.normalize = normalize
      self.lowrank = lowrank
      self.rankbound = rankbound
  
      self._reshape_kwargs = {
          "numfeatures": numfeatures,
          "subsample": subsample,
          "differences": differences,
      }
      self._kern_kwargs = {
          "level": level,
          "degree": degree,
          "theta": theta,
          "normalize": normalize,
          "lowrank": lowrank,
          "rankbound": rankbound,
      }
  
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 1 to create a new SeqKernelizer object from inherited base classes: BaseEstimator, TransformerMixin with example: obj = SeqKernelizer(level, degree, theta, kernel, scale, deg, numfeatures, subsample, differences, normalize, lowrank, rankbound)