RocketClassifier
Classifier wrapped for the Rocket transformer using RidgeClassifierCV.
This classifier simply transforms the input data using the Rocket [1] transformer and builds a RidgeClassifierCV estimator using the transformed data.
Shorthand for the pipeline rocket * StandardScaler(with_mean=False) * RidgeClassifierCV(alphas) where alphas = np.logspace(-3, 3, 10), and where rocket depends on params rocket_transform, use_multivariate as follows
classes are sktime classes, other parameters are passed on to the rocket class.
To build other classifiers with rocket transformers, use make_pipeline or the pipeline dunder *, and different transformers/classifiers in combination.
Schnellstart
from sktime.classification.kernel_based import RocketClassifier
estimator = RocketClassifier(num_kernels=10000, rocket_transform='rocket', max_dilations_per_kernel=32, n_features_per_kernel=4, use_multivariate='auto', n_jobs=1, random_state=None)Parameter(7)
- num_kernelsint, optional, default=10,000
- The number of kernels for the Rocket transform.
- rocket_transformstr, optional, default=”rocket”
- The type of Rocket transformer to use. Valid inputs = [“rocket”, “minirocket”, “multirocket”]
- max_dilations_per_kernelint, optional, default=32
- MiniRocket and MultiRocket only. The maximum number of dilations per kernel.
- n_features_per_kernelint, optional, default=4
- MultiRocket only. The number of features per kernel.
- use_multivariatestr, [“auto”, “yes”, “no”], optional, default=”auto”
- whether to use multivariate rocket transforms or univariate ones “auto” = multivariate iff data seen in fit is multivariate, otherwise univariate “yes” = always uses multivariate transformers, native multi/univariate “no” = always univariate transformers, multivariate by framework vectorization
- n_jobsint, default=1
The number of jobs to run in parallel for both
fitandpredict.-1means using all processors.- random_stateint or None, default=None
- Seed for random number generation.
Beispiele
>>> from sktime.classification.kernel_based import RocketClassifier
>>> from sktime.datasets import load_unit_test
>>> X_train, y_train = load_unit_test (split = "train", return_X_y = True)
>>> X_test, y_test = load_unit_test (split = "test", return_X_y = True)
>>> clf = RocketClassifier (num_kernels = 500)
>>> clf. fit (X_train, y_train) RocketClassifier(
... )
>>> y_pred = clf. predict (X_test)Referenzen
Dempster, Angus, François Petitjean, and Geoffrey I. Webb. “Rocket: exceptionally fast and accurate time series classification using random convolutional kernels.” Data Mining and Knowledge Discovery 34.5 (2020)