Join GitHub today
GitHub is home to over 50 million developers working together to host and review code, manage projects, and build software together.
Sign upImplemented optimism bootstrap #544
Conversation
Best practice
For nominal workflow
|
Looks great. Thanks |
|
Uh actually, there is a bug. The last call generated an error of library(caret)
set.seed(24)
dat <- twoClassSim(1000)
set.seed(34521)
opt_acc <- train(Class ~ ., data = dat,
method = "svmRadial",
preProc = c("center", "scale"),
tuneLength = 10,
trControl=trainControl(method = "optimism_boot"))
set.seed(34521)
opt_acc_probs <- train(Class ~ ., data = dat,
method = "svmRadial",
preProc = c("center", "scale"),
tuneLength = 10,
trControl=trainControl(method = "optimism_boot",
classProbs = TRUE))
set.seed(34521)
opt_roc <- train(Class ~ ., data = dat,
method = "svmRadial",
preProc = c("center", "scale"),
tuneLength = 10,
metric = "ROC",
trControl=trainControl(method = "optimism_boot",
classProbs = TRUE,
summaryFunction = twoClassSummary)) |
|
In rocAUC <- ModelMetrics::auc(ifelse(data$obs == lev[2], 0, 1), data[, lvls[1]])It seems that EDIT: nevermind, I'm not adding the |
Some time ago I implemented the optimism bootstrap to test it. I also added a method
boot_allto get all bootstrap estimates in one run. If you want to include these, you can merge this branch. I added the reference to the documentation oftrainControl. There is some more info in this post too.I also added the
.onUnloadfunction, which should be used when a package uses compiled code (see good practice here)