Which is the most recommendable number of iterations for the function; BayesianOptimization, in R

I want to optimize the hyperparameters of the function: xgb.cv, with the library: rBayesianOptimization in R, therefore, I would like to know how many iterations of the function: BayesianOptimization, are necessary to obtain the most optimal result.

I have a data set of 5741 rows and 103 columns.


library(xgboost)
library(Matrix)
library(rBayesianOptimization)

data(agaricus.train, package = “xgboost”)

dtrain <- xgb.DMatrix(agaricus.train$data,
label = agaricus.train$label)

cv_folds <- KFold(agaricus.train$label, nfolds = 5,
stratified = TRUE, seed = 0)

xgb_cv_bayes <- function(eta,colsample_bytree,max_depth, min_child_weight) {

cv <- xgb.cv(params = list(eta= eta,
colsample_bytree=colsample_bytree,
max_depth = max_depth,
min_child_weight = min_child_weight,
gamma = 1,
max_delta_step =1,
missing =NA,
objective = “binary:logistic”,
eval_metric = “auc”),

           data = dtrain, nround = 1000,
           folds = cv_folds, prediction = TRUE, showsd = TRUE,
           early_stopping_rounds = 5, maximize = TRUE, verbose = 0)

list(Score = cv$evaluation_log$test_auc_mean[cv$best_iteration],
Pred = cv$pred)
}

OPT_Res <- BayesianOptimization(xgb_cv_bayes,
bounds = list(eta= c(0.001, 0.001, 0.3, 0.9 ),
colsample_bytree = c(0.1,0.5),
max_depth = c(4L, 6L, 8L, 10L),
min_child_weight = c(1L, 10L)
),

                         init_grid_dt = NULL, init_points = 10, **n_iter = 200**, # HERE, HELP ME!
                            acq = "ucb", kappa = 2.576, eps = 0.0,
                            verbose = TRUE)