I am trying to tune gradient boosting (caret package) with differential evolution (DEOptim) in R language. I have a question, is correct to define the maximum of accuracy at each iteration in my eval function as the following?
return(XGBoost_model$results$Accuracy) # Maximum Accuracy
I am asking this question because when I plot the result, the plot shows a descending graphic.
My eval function is defined as follow:
XGBoost_model <- caret::train(isMut ~.,
data = data,
method = "gbm",
trControl = train_settings,
verbose = FALSE,
tuneGrid = expand.grid(
interaction.depth = round(x1), # number of depth
n.trees = round(x2), # number of tree
shrinkage = 0.1,
n.minobsinnode = 20
)
)
)
return(XGBoost_model$results$Accuracy) # Maximum Accuracy
}
# Define minimum and maximum values for each input
interaction.depth_min_max <- c(1,9)
n.trees_min_max <- c(1500,2000)