selectQ: Select Q best dimension

Description Usage Arguments Value See Also Examples

Description

This function applies DB-CSP and classification with different dimensions to see which gets the best outcomes.

Usage

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
selectQ(
  object,
  Q = c(1, 2, 3, 5, 10, 15),
  train_size = 0.75,
  CV = FALSE,
  folds = 10,
  seed = NULL
)

## S4 method for signature 'dbcsp'
selectQ(
  object,
  Q = c(1, 2, 3, 5, 10, 15),
  train_size = 0.75,
  CV = FALSE,
  folds = 10,
  seed = NULL
)

Arguments

object

object of class dbcsp.

Q

list of integers which represents the dimensions to use, by default Q=c(1,2,3,5,10,15).

train_size

float between 0.0 and 1.0 representing the proportion of the dataset to include in the train split, by default train_size=0.75.

CV

logical indicating if a cross validation must be performed or not (if TRUE, train_size is not used), by default CV=FALSE.

folds

integer, number of folds to use if CV is performed.

seed

numeric value, by default seed=NULL. Set a seed in case the results want to be replicable.

Value

A data.frame including the dimensions and their corresponding accuracies. If CV=TRUE, for each dimension, the standard deviation of the accuracy values of the folds is also included in the data frame.

See Also

dbcsp, print, summary, train, predict, plot, boxplot

Examples

1
2
3
4
5
6
# Read data from 2 classes
x <- AR.data$come
y <- AR.data$five
mydbcsp <- new("dbcsp", X1 = x, X2 = y)
result <- selectQ(mydbcsp)
print(result)

dbcsp documentation built on July 9, 2021, 9:08 a.m.