# Change settings in the prediction model (caret package)

I am using the package caret and GBM method for my predictions.

fitControl <- trainControl(## 10-fold CV
method = "repeatedcv",
number = 10,
## repeated ten times
repeats = 10)

gbmGrid <-  expand.grid(interaction.depth = c(1, 5, 9),
n.trees = (1:30)*50,
shrinkage = 0.1)

gbmFit <- train(target ~ ., data = traindf,
method = "gbm",
trControl = fitControl,
verbose = FALSE,
## Now specify the exact models
## to evaludate:
tuneGrid = gbmGrid,
metric = "ROC")


There is one concept that I misunderstand. User guides of caret say that "By default, the train function chooses the model with the largest performance value (or smallest, for mean squared error in regression models)." So, when I run ggplot(gbmFit) I get this graphic:

When I type gbmFit in the console, I see that "The final values used for the model were n.trees = 300, interaction.depth = 9 and shrinkage = 0.1" How can I manually change these settings in order to make my predictions with different number of boosting iterations and trees?:

predictions_gbm <- predict(gbmFit, newdata = testdf, type = "raw")


See ?update.train. For example:
new_mod <- update(gbmFit, list(n.trees = 100,