Why is it so slow with objective="binary:logitraw"?


I have observed a big running time difference with objective=“binary:logistic” and objective=“binary:logitraw” in R with xgboost. Here is a simple example.

system.time(fit1 <- xgboost(x, g2, nrounds=500, objective=“binary:logistic”, verbose=0))
user system elapsed
3.334 0.023 0.283
system.time(fit1 <- xgboost(x, g2, nrounds=500, objective=“binary:logitraw”, verbose=0))
user system elapsed
119.860 0.572 10.217

R version 4.0.3 (2020-10-10)
Platform: x86_64-pc-linux-gnu (64-bit)
Running under: Ubuntu 18.04.5 LTS
other attached packages:
[1] xgboost_1.2.0.1

I’ve reproduced the bug on my machine. Here is the tracking issue: https://github.com/dmlc/xgboost/issues/6618

@john Hello, in your example script, you should add eval_metric="logloss" to make the first model train as fast as the second model. Currently, XGBoost sets AUCROC as the default evaluation metric for objective="binary:logitraw", whereas the log loss is used for objective="binary:logistic". AUCROC is quite slow.

For now, please explicitly specify eval_metric="logloss" to speed up training.

Thanks. That’s very helpful information.