Understanding and using the boosting module
Unlike bagging, which focuses on reducing variance, the goal of boosting is to reduce bias without increasing variance.
Bagging creates a bunch of base estimators with equal importance, or weights, in terms of determining the final prediction. The data that's fed into the base estimators is also uniformly resampled from the training set.
Determining the possibility of parallel processing
From the description of bagging we provided, you may imagine that it is relatively easy to run bagging algorithms. Each process can independently perform sampling and model training. Aggregation is only performed at the last step, when all the base estimators have been trained. In the preceding code snippet, I set n_jobs
= 20
to build the bagging classifier. When it is being trained, 20 cores on the host machine will be used at most.
Boosting solves a different problem. The primary goal is to create an estimator with low bias. In the world...