## ----include = FALSE----------------------------------------------------------
knitr::opts_chunk$set(
  collapse = TRUE,
  comment = "#>"
)

## ----setup--------------------------------------------------------------------
library(minirocketR)

# Generate synthetic data: 50 training series, 20 test series, length 100
set.seed(42)
N_train <- 50
N_test  <- 20
L       <- 100

X_train <- matrix(rnorm(N_train * L), nrow = N_train, ncol = L)
X_test  <- matrix(rnorm(N_test * L),  nrow = N_test,  ncol = L)

## ----fit----------------------------------------------------------------------
model <- minirocket_fit(X_train, num_features = 10000, seed = 42)

## ----transform----------------------------------------------------------------
# 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)
dim(X_test_feat)

