Good afternoon people!
I'm taking my first steps in an RMD file where I apply classifiers to a dataset. I would like to get the runtime of each classifier on my data. In this case, the classifiers are thus in a single block.
#A. Global options that we will use in all our trained models
ctrl <- trainControl(method = 'cv',
number = 10,
classProbs = TRUE,
summaryFunction = twoClassSummary)
#B. Decision Tree: original data
dt_orig <- train(Case ~ .,
data = train.orig,
method = "rpart",
trControl = ctrl,
metric = "ROC")
#C. Naive Bayes: original data
nb_orig <- train(Case ~ .,
data = train.orig,
method = "naive_bayes",
trControl = ctrl,
metric = "ROC")
#D. Linear Discriminant Analysis: original data
lda_orig <- train(Case ~ .,
data = train.orig,
method = "lda",
trControl = ctrl,
metric = "ROC")
#E. Logistic Regression: original data
lr_orig <- train(Case ~ .,
data = train.orig,
method = "bayesglm",
trControl = ctrl,
metric = "ROC")
#F. Random Forest: original data
rf_orig <- train(Case ~ .,
data = train.orig,
method = "rf",
trControl = ctrl,
metric = "ROC")
So for each applied classifier I would like to get its separate runtime. Any rather simple way to do this? I'm new to R and especially R Markdown.
I appreciate any help!