Open ghost opened 6 years ago
I couldn't reproduce the error, as following.
> set.seed(71)
> res0 <- xgb_cv_opt(data = df_example,
+ label = y,
+ objectfun = "binary:logistic",
+ evalmetric = "auc",
+ n_folds = 3,
+ classes = 10,
+ init_points = 4,
+ n_iter = 5)
elapsed = 0.01 Round = 1 eta_opt = 0.4475 max_depth_opt = 5.0000 nrounds_opt = 86.7596 subsample_opt = 0.1971 bytree_opt = 0.7882 Value = 0.5852
elapsed = 0.01 Round = 2 eta_opt = 0.1121 max_depth_opt = 5.0000 nrounds_opt = 144.4636 subsample_opt = 0.7513 bytree_opt = 0.8698 Value = 0.6113
elapsed = 0.01 Round = 3 eta_opt = 0.4441 max_depth_opt = 5.0000 nrounds_opt = 130.1620 subsample_opt = 0.4701 bytree_opt = 0.7318 Value = 0.5542
elapsed = 0.01 Round = 4 eta_opt = 0.8827 max_depth_opt = 5.0000 nrounds_opt = 141.4816 subsample_opt = 0.8389 bytree_opt = 0.7178 Value = 0.5254
elapsed = 0.01 Round = 5 eta_opt = 0.1328 max_depth_opt = 5.0000 nrounds_opt = 104.9175 subsample_opt = 0.3617 bytree_opt = 0.8559 Value = 0.5064
elapsed = 0.01 Round = 6 eta_opt = 0.8979 max_depth_opt = 5.0000 nrounds_opt = 153.8820 subsample_opt = 0.1759 bytree_opt = 0.8697 Value = 0.5993
elapsed = 0.01 Round = 7 eta_opt = 0.4374 max_depth_opt = 5.0000 nrounds_opt = 141.3386 subsample_opt = 0.1684 bytree_opt = 0.8699 Value = 0.3771
elapsed = 0.01 Round = 8 eta_opt = 0.7030 max_depth_opt = 4.0000 nrounds_opt = 144.5133 subsample_opt = 0.4369 bytree_opt = 0.8664 Value = 0.5131
elapsed = 0.02 Round = 9 eta_opt = 0.6536 max_depth_opt = 6.0000 nrounds_opt = 147.7658 subsample_opt = 0.7710 bytree_opt = 0.8733 Value = 0.6066
Best Parameters Found:
Round = 2 eta_opt = 0.1121 max_depth_opt = 5.0000 nrounds_opt = 144.4636 subsample_opt = 0.7513 bytree_opt = 0.8698 Value = 0.6113
I wonder that error is because of random seed or something...
If you still get error, try to increase the kappa
parameter of acquisition function.
Infinite values of the Deviance Function
This error often means the searching parameter fails because of local maximum point.
Increasing kappa
enables to enlarge the parameter space to search.
Strange, when I run the code I'm still getting the exact same error after four rounds. I tried multiple seeds, and increasing kappa but nothing seems to be working.
I had a friend run the code and he got the same error after four rounds. We are both running R version 3.5.1 and have fresh installs of MlBaysOpt
Here's my session info
R version 3.5.1 (2018-07-02)
Platform: x86_64-w64-mingw32/x64 (64-bit)
Running under: Windows >= 8 x64 (build 9200)
Matrix products: default
locale:
[1] LC_COLLATE=English_United States.1252 LC_CTYPE=English_United States.1252
[3] LC_MONETARY=English_United States.1252 LC_NUMERIC=C
[5] LC_TIME=English_United States.1252
attached base packages:
[1] stats graphics grDevices utils datasets methods base
other attached packages:
[1] MlBayesOpt_0.3.3
loaded via a namespace (and not attached):
[1] Rcpp_0.12.18 rstudioapi_0.7
[3] bindr_0.1.1 magrittr_1.5
[5] GPfit_1.0-0 tidyselect_0.2.4
[7] lattice_0.20-35 R6_2.2.2
[9] rlang_0.2.1 foreach_1.4.4
[11] dplyr_0.7.6 tools_3.5.1
[13] grid_3.5.1 data.table_1.11.4
[15] e1071_1.7-0 class_7.3-14
[17] iterators_1.0.10 yaml_2.2.0
[19] xgboost_0.71.2 assertthat_0.2.0
[21] tibble_1.4.2 crayon_1.3.4
[23] Matrix_1.2-14 bindrcpp_0.2.2
[25] purrr_0.2.5 lhs_0.16
[27] codetools_0.2-15 glue_1.3.0
[29] stringi_1.1.7 compiler_3.5.1
[31] pillar_1.3.0 ranger_0.10.1
[33] rBayesianOptimization_1.1.0 pkgconfig_2.0.1 `
Sorry, I tried in old version of R (3.4.4). When I tried in R 3.5.1, I got an error, but the error occurred after 7 rounds and the error message was different.
Error in { : task 29 failed - "non-finite value supplied by optim"
Calls: xgb_cv_opt ... Utility_Max -> %>% -> eval -> eval -> %do% -> <Anonymous>
My main machine is Mac, so I'll research on Windows. Please wait a minute.
I had the same error.
What worked for me was to change the acquisition function from Expected improvement to GP lower confidence bound.
I too am getting a similar error: Error in { : task 64 failed - "non-finite value supplied by optim". I am running Windows, R version 3.5.2.
Changing acq = "ucb" seems to fix problem... (granted, it changes the acquisition function).
When using the
xgb_cv_opt
function I get the following error after four rounds.Error in GP_deviance(param_init_200d[i, ], X, Y, nug_thres, corr = corr) : Infinite values of the Deviance Function, unable to find optimum parameters
I found this page
https://github.com/yanyachen/rBayesianOptimization/issues/36
talking about the same error in the rbayesianoptimization package and tried playing around with the parameter ranges but still cannot get the optimization to run. Reproducible example below.