RocketPyts
RandOm Convolutional KErnel Transform (ROCKET), from pyts.
Direct interface to pyts.transformation.rocket.
ROCKET [1] generates random convolutional kernels, including random length and dilation. It transforms the time series with two features per kernel. The first feature is global max pooling and the second is proportion of positive values.
This transformer fits one set of paramereters per individual series, and applies the transform with fitted parameter i to the i-th series in transform. Vanilla use requires same number of series in fit and transform.
To fit and transform series at the same time, without an identification of fit/transform instances, wrap this transformer in FitInTransform, from sktime.transformations.compose.
Quickstart
from sktime.transformations.rocket import RocketPyts
estimator = RocketPyts(n_kernels=10000, kernel_sizes=(7, 9, 11), random_state=None)Parameters(3)
- n_kernelsint (default = 10000)
- Number of kernels.
- kernel_sizesarray-like (default = (7, 9, 11))
- The possible sizes of the kernels.
- random_stateNone, 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.
Examples
>>> from sktime.transformations.rocket import RocketPyts
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test (split = "train")
>>> X_test, y_test = load_unit_test (split = "test")
>>> trf = RocketPyts (num_kernels = 512)
>>> trf. fit (X_train) Rocket(
... )
>>> X_train = trf. transform (X_train)
>>> X_test = trf. transform (X_test)References
- Tan, Chang Wei and Dempster, Angus and Bergmeir, Christoph
and Webb, Geoffrey I, “ROCKET: Exceptionally fast and accurate time series
classification using random convolutional kernels”,2020, https://link.springer.com/article/10.1007/s10618-020-00701-z, https://arxiv.org/abs/1910.13051