train_model: Train binary classifier

Description Usage Arguments Value Author(s) Examples

View source: R/train_model.R

Description

Loads EEG data and writes cleaned data to an output directory

Usage

1
train_model(DATtrain,LABtrain,DATval,LABval,featuredict,classifier="rf")

Arguments

DATtrain

Training feature values as produced by extract_features and split up by split_data

LABtrain

Training labels as derived from split_data

DATval

Validation feature values as produced by extract_features and split up by split_data

LABval

Validation labels as derived from split_data

featuredict

Dataframe with all overview of all available combinations of wavelet types, wavelet levels, extracted signal features, and aggregation type.

classifier

type of classification model, defaul is "rf" for random forrest. Alternative value could be "lg" for logistic regression

Value

result

classificiation performance in the validation set for each value of the hyperparameter

best_model

classification model as produced by caret function train

fes

column indices of the DAT corresponding to the features used for the best model

Author(s)

Vincent T van Hees

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
## Not run: 
  data(data.eeg)
  data(data.labels)
  RDL = reformat_DATLAB(data.eeg,data.labels,aggregateperid=TRUE)
  DAT = RDL$DAT
  LAB = RDL$LAB
  P = split_data(LAB,DAT,logfile = logfile,proto_i=1,split=c(2,2),
                 uselog = FALSE,logdur=10)
  LABval = P$LABval;LABtest=P$LABtest;LABtrain=P$LABtrain
  DATval=P$DATval;DATtest=P$DATtest;DATtrain=P$DATtrain
  featuredict = create_featuredict(DAT)
  mymodel = train_model(DATtrain,LABtrain,DATval,LABval,featuredict,classifier="rf")

## End(Not run)

NLeSC/EEG-epilepsy-diagnosis documentation built on May 7, 2019, 6:02 p.m.