Skip to content

Instantly share code, notes, and snippets.

@monogenea
Created October 7, 2019 18:57
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save monogenea/4828af010cb4d5342b882b942ae8d104 to your computer and use it in GitHub Desktop.
Save monogenea/4828af010cb4d5342b882b942ae8d104 to your computer and use it in GitHub Desktop.
# Compile cross-validation settings
set.seed(100)
myfolds <- createMultiFolds(arcene$class, k = 5, times = 10)
control <- trainControl("repeatedcv", index = myfolds, selectionFunction = "oneSE")
# Train PLS model
mod1 <- train(class ~ ., data = arcene,
method = "pls",
metric = "Accuracy",
tuneLength = 20,
trControl = control,
preProc = c("zv","center","scale"))
# Check CV profile
plot(mod1)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment