Skip to contents

Adapts catch22(), rocket(), or minirocket() output without adding an outcome or changing the feature transform. For convolution methods, pass a model fitted only on training cases when transforming validation/test cases.

Usage

peReducedFeatures(
  x,
  method = c("catch22", "rocket", "minirocket"),
  model = NULL,
  assay_name = NULL,
  channels = NULL,
  cases = NULL,
  ...
)

Arguments

x

A PhysioExperiment.

method

Exactly one of "catch22", "rocket", or "minirocket".

model

NULL or a fitted convolution-transform model. Must be NULL for catch22.

assay_name, channels, cases

Input selection; see catch22().

...

Method-specific arguments.

Value

A numeric matrix with class physio_feature_matrix. Attributes preserve exact case identity, feature provenance, typed diagnostics, and the fitted model when applicable.

Examples

arr <- array(stats::rnorm(40 * 2 * 3), dim = c(40, 2, 3))
pe <- PhysioExperiment::PhysioExperiment(
  assays = list(raw = arr),
  colData = S4Vectors::DataFrame(label = c("C3", "C4")),
  samplingRate = 100
)
# catch22 features need the optional Rcatch22 backend.
if (requireNamespace("Rcatch22", quietly = TRUE)) {
  features <- peReducedFeatures(pe, method = "catch22")
  dim(features)
}
#> [1]  3 44