dmlc / XGBoost.jl

XGBoost Julia Package
Other
288 stars 110 forks source link

removing info printed when using xgboost #151

Closed mlesnoff closed 1 year ago

mlesnoff commented 1 year ago

Is there a way to remove all the info printed when using xgboost?

The doc https://xgboost.readthedocs.io/en/stable/parameter.html indicates:

verbosity [default=1] Verbosity of printing messages. Valid values are 0 (silent), 1 (warning), 2 (info), 3 (debug). Sometimes XGBoost tries to change configurations based on heuristics, which is displayed as warning message. If there’s unexpected behaviour, please try to increase value of verbosity.

But doing:

using XGBoost (X, y) = (randn(100,4), randn(100)) bst = xgboost((X, y); verbosity = 0)

does not remove the printing. I also tried verbosity = "0" and silent = "0", which does not work.

Is there a solution?

ExpandingMan commented 1 year ago

You need to also set watchlist=(;) (or some other empty collection)

mlesnoff commented 1 year ago

bst = xgboost((X, y), watchlist = (;)) ;

this works, thanks!