KFCV.array {TSEAL}R Documentation

Generates and validates a discriminant model generated directly from the data.

Description

It generates and validates a discriminant model starting from the data. First , a MultiWaveAnalysis object is obtained according to the selected characteristics ,filter and levels. Then, the most important features are selected using a stepwise discriminant that allows to select a maximum number of variables (maxvars) or a minimum enhancement step (VStep). Finally, the model is trained using the subset of features and validated using K-Fold Cross Validation (KFCV).

Usage

## S3 method for class 'array'
KFCV(
  data,
  labels,
  f,
  method,
  maxvars,
  VStep,
  k = 5L,
  lev = 0L,
  features = c("Var", "Cor", "IQR", "PE", "DM"),
  returnClassification = FALSE,
  nCores = 0,
  ...
)

Arguments

data

Sample from the population (dim x length x cases)

labels

Labeled vector that classify the observations

f

Selected filter for the MODWT (to see the available filters use the function availableFilters

method

Selected method for the discriminant. Valid values "linear" "quadratic"

maxvars

Maximum number of variables included by the StepDiscrim algorithm (Note that if you defined this, can not define VStep). Must be a positive integer greater than 0.

VStep

Minimum value of V above which all other variables are considered irrelevant and therefore will not be included. (Note that if you defined this, can not defined maxvars). Must be a positive number and greater than 0. For more information see StepDiscrim documentation

k

The number of folds in KFCV. Must be a positive integer lower or equal than the number of observations

lev

Determines the number of decomposition levels for MODWT (by default the optimum is calculated using the "conservative" strategy). Must be a positive integer (including 0 to auto-select the level)

features

A list of characteristics that will be used for the classification process. To see the available features see availableFeatures

returnClassification

Allows to select if the raw result classification is returned.

nCores

Determines the number of processes that will be used in the function, by default it uses all but one of the system cores. Must be a positive integer, where 0 corresponds to the default behavior.

...

Additional arguments

Value

See Also

Examples


load(system.file("extdata/ECGExample.rda",package = "TSEAL"))
labels <- c(rep(1, 5), rep(2, 5))
CM <- KFCV(ECGExample, labels, "haar", "linear",
  maxvars = 5,
  features = c("Var"), returnClassification = FALSE
)
# or with VStep
CMV <- KFCV(ECGExample, labels, "haar", "linear",
 k = 5,
 VStep = 5,
 features = c("Var"), returnClassification = FALSE
)


[Package TSEAL version 0.1.3 Index]