What does n_jobs=-1 do in XGBClassifier from xgboost?

121 views Asked by At

What does the n_jobs=-1 means do when creating a XGBClassifier object?

xgbc = XGBClassifier(n_jobs=-1)
1

There are 1 answers

2
Ivan Verges On

The n_jobs parameter defines the number of parallel threads to run xgboost. When passing "-1" to the "n_jobs" parameter, the computation will be dispatched to all parallel threads available in the computer.

You can get more details from the official API Reference: https://xgboost.readthedocs.io/en/stable/python/python_api.html#xgboost.XGBClassifier