class_docstr: RandOm Convolutional KErnel Transformation.
  
  This algorithm randomly generates a great variety of convolutional kernels
  and extracts two features for each convolution: the maximum and the
  proportion of positive values.
  
  Parameters
  ----------
  n_kernels : int (default = 10000)
      Number of kernels.
  
  kernel_sizes : array-like (default = (7, 9, 11))
      The possible sizes of the kernels.
  
  random_state : None, int or RandomState instance (default = None)
      The seed of the pseudo random number generator to use when shuffling
      the data. If int, random_state is the seed used by the random number
      generator. If RandomState instance, random_state is the random number
      generator. If None, the random number generator is the RandomState
      instance used by `np.random`.
  
  Attributes
  ----------
  weights_ : array, shape = (n_kernels, max(kernel_sizes))
      Weights of the kernels. Zero padding values are added.
  
  length_ : array, shape = (n_kernels,)
      Length of each kernel.
  
  bias_ : array, shape = (n_kernels,)
      Bias of each kernel.
  
  dilation_ : array, shape = (n_kernels,)
      Dilation of each kernel.
  
  padding_ : array, shape = (n_kernels,)
      Padding of each kernel.
  
  References
  ----------
  .. [1] A. Dempster, F. Petitjean and G. I. Webb, "ROCKET: Exceptionally
         fast and accurate time series classification using random
         convolutional kernels". https://arxiv.org/abs/1910.13051.
  
  Examples
  --------
  >>> from pyts.transformation import ROCKET
  >>> X = np.arange(100).reshape(5, 20)
  >>> rocket = ROCKET(n_kernels=10)
  >>> rocket.fit_transform(X).shape
  (5, 20)
class_docstr_tok: ["RandOm","Convolutional","KErnel","Transformation",".","This","algorithm","randomly","generates","a","great","variety","of","convolutional","kernels","and","extracts","two","features","for","each","convolution",":","the","maximum","and","the","proportion","of","positive","values",".","Parameters","--","--","--","--","--","n_kernels",":","int","(","default","=","10000",")","Number","of","kernels",".","kernel_sizes",":","array-like","(","default","=","(","7",",","9",",","11",")",")","The","possible","sizes","of","the","kernels",".","random_state",":","None",",","int","or","RandomState","instance","(","default","=","None",")","The","seed","of","the","pseudo","random","number","generator","to","use","when","shuffling","the","data",".","If","int",",","random_state","is","the","seed","used","by","the","random","number","generator",".","If","RandomState","instance",",","random_state","is","the","random","number","generator",".","If","None",",","the","random","number","generator","is","the","RandomState","instance","used","by","`","np.random","`",".","Attributes","--","--","--","--","--","weights_",":","array",",","shape","=","(","n_kernels",",","max","(","kernel_sizes",")",")","Weights","of","the","kernels",".","Zero","padding","values","are","added",".","length_",":","array",",","shape","=","(","n_kernels",",",")","Length","of","each","kernel",".","bias_",":","array",",","shape","=","(","n_kernels",",",")","Bias","of","each","kernel",".","dilation_",":","array",",","shape","=","(","n_kernels",",",")","Dilation","of","each","kernel",".","padding_",":","array",",","shape","=","(","n_kernels",",",")","Padding","of","each","kernel",".","References","--","--","--","--","--","..","[","1","]","A.","Dempster",",","F.","Petitjean","and","G.","I.","Webb",",","``","ROCKET",":","Exceptionally","fast","and","accurate","time","series","classification","using","random","convolutional","kernels","''",".","https",":","\/\/arxiv.org\/abs\/1910.13051",".","Examples","--","--","--","--",">",">",">","from","pyts.transformation","import","ROCKET",">",">",">","X","=","np.arange","(","100",")",".reshape","(","5",",","20",")",">",">",">","rocket","=","ROCKET","(","n_kernels=10",")",">",">",">","rocket.fit_transform","(","X",")",".shape","(","5",",","20",")"]
docstr: Fit the model according to the given training data.
  
  Parameters
  ----------
  X : array-like, shape = (n_samples, n_timestamps)
      Training vector.
  
  y : None or array-like, shape = (n_samples,)
      Class labels for each data sample. Ignored.
  
  Returns
  -------
  self : object
docstr_tok: ["Fit","the","model","according","to","the","given","training","data",".","Parameters","--","--","--","--","--","X",":","array-like",",","shape","=","(","n_samples",",","n_timestamps",")","Training","vector",".","y",":","None","or","array-like",",","shape","=","(","n_samples",",",")","Class","labels","for","each","data","sample",".","Ignored",".","Returns","--","--","--","-","self",":","object"]
code: def fit(self, X, y=None):
      """Fit the model according to the given training data.
  
      Parameters
      ----------
      X : array-like, shape = (n_samples, n_timestamps)
          Training vector.
  
      y : None or array-like, shape = (n_samples,)
          Class labels for each data sample. Ignored.
  
      Returns
      -------
      self : object
  
      """
      X = check_array(X, dtype="float64")
      n_samples, n_timestamps = X.shape
  
      kernel_sizes, seed = self._check_params(n_timestamps)
  
      # Generate the kernels
      weights, lengths, biases, dilations, paddings = generate_kernels(
          self.n_kernels, n_timestamps, kernel_sizes, seed
      )
  
      self.weights_ = weights
      self.length_ = lengths
      self.bias_ = biases
      self.dilation_ = dilations.astype("int64")
      self.padding_ = paddings.astype("int64")
  
      return self
  
file_path: pyts/pyts/transformation/rocket.py
imports: from numba import njit, prange
  import numpy
  from sklearn.base import BaseEstimator
  from sklearn.utils.validation import check_array, check_is_fitted, check_random_state
  from ..base import UnivariateTransformerMixin
label_desc: Use image node_id 2 for calling the ROCKET obj's underlying member method code with example usage: obj.fit(X, y) and returns: self