mowglis_diaper
mowglis_diaper

Reputation: 509

How can I parallelize fitting a gradient boosting model with sklearn?

Relatively new to model building with sklearn. I know cross validation can be parallelized via the n_jobs parameter, but if I'm not using CV, how can I utilize my available cores to speed up model fitting?

Upvotes: 9

Views: 6775

Answers (2)

Seyit Hocuk
Seyit Hocuk

Reputation: 89

There are alternatives like XGboost or LigtGMB that are distributed (i.e., can run parallel). These are well documented and popular boosting algorithms.

Upvotes: 2

Renata Ghisloti
Renata Ghisloti

Reputation: 557

At the moment afaik there is no parameter like "n_jobs" for the GradientBoosting method, but you can try to use the HistGradientBoostingRegressor which uses OpenMP for parallelization (will use as many threads as possible).

You can read more here: https://scikit-learn.org/stable/modules/ensemble.html https://scikit-learn.org/stable/modules/computing.html#parallelism

Upvotes: 1

Related Questions