minirocketR provides an optimized R implementation of
the MiniRocket time series feature extraction algorithm
(Dempster et al., 2021). Built with a native C++ core via
Rcpp and accelerated with OpenMP multithreading, it
generates \(9,996\) Proportion of
Positive Values (PPV) features per time series while maintaining exact
mathematical parity with the Python reference implementation
(sktime).
Load the package and generate synthetic time series data (where rows represent \(N\) time series instances and columns represent time points \(L\)):
Fit the minirocket model on the training data. This step
samples dilation values, generates golden-ratio quasi-random quantiles,
and calibrates feature biases using single-series convolutions:
Apply the fitted transformer to both training and test matrices. You
can configure the num_threads argument to leverage
multi-core CPU acceleration (requires OpenMP support):
# Transform the time series into the feature space
X_train_feat <- minirocket_transform(model, X_train, num_threads = 2)
X_test_feat <- minirocket_transform(model, X_test, num_threads = 2)
# Verify the dimensions of the output feature matrices
dim(X_train_feat)
#> [1] 50 9996
dim(X_test_feat)
#> [1] 20 9996Both outputs produce matrices with \(9,996\) columns bounded strictly in the
range \([0, 1]\). These standardized
features are now ready to be fed into downstream classification or
regression models, such as Ridge Regression (e.g., via the
glmnet package) or XGBoost.
Dempster, A., Petitjean, F., & Webb, G. I. (2021). MINIROCKET: A Very Fast (Almost) Deterministic Transform for Time Series Classification. Data Mining and Knowledge Discovery, 35(5), 2154–2177.