Back to models
Transformer

Rocket

RandOm Convolutional KErnel Transform (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

python
from sktime.transformations.rocket import Rocket

estimator = Rocket(num_kernels=10000, normalise=True, n_jobs=1, random_state=None)

Parameters(4)

num_kernelsint, default=10,000
number of random convolutional kernels.
normaliseboolean, default True
whether or not to normalise the input time series per instance.
n_jobsint, default=1

The number of jobs to run in parallel for transform. -1 means use all processors.

random_stateNone or int, optional, default = None

Examples

>>> from sktime.transformations.rocket import Rocket
>>> 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 = Rocket (num_kernels = 512)
>>> trf. fit (X_train) Rocket(
... )
>>> X_train = trf. transform (X_train)
>>> X_test = trf. transform (X_test)

References

[1]
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