Additive weak learners
Quick answer
Boosting builds a predictor in stages. Each new learner is fitted using information from the existing ensemble. Unlike bagging, later learners depend on earlier ones. For regression, the combined prediction can be an initial value plus a sequence of weighted corrections. Examples are static and locally tested with Python 3.13.5, scikit-learn 1.8.0 and NumPy 2.3.5 where imported. ByteMind package execution is unverified.
Trace an additive prediction
base = 10corrections = [4, -1]print(base + sum(0.5*c for c in corrections))Observed local output:
11.5The second learner reduces the first correction; the result is not the average of three predictions.
How it works
An additive model has the form F_m(x) = F_0(x) + sum(a_j h_j(x), j=1..m). Here F_0 is the starting prediction, h_j is one learner and a_j controls its contribution. A decision stump is a tree with one split; it may capture a useful pattern without solving the entire task. A weak learner in theoretical binary boosting is one that can perform better than chance under the current weighted distribution; a shallow tree is a practical candidate, not a guarantee of that condition. Imagine predicting a machine’s energy use: a constant baseline predicts 10 units, a first tree adds 4 for a busy machine, and a later tree subtracts 1 for an efficient machine. With a contribution weight of 0.5 for each tree, the result is 11.5. The correction need not be positive. During inference, evaluate all selected learners on the same input and combine their contributions. In training, boosting changes the problem given to the next learner; bagging instead trains learners independently given their sampled data. A boosted binary classifier may add raw scores rather than class labels or probabilities; the link function depends on the objective. More stages may fit useful structure or noise, so stage count is a hyperparameter, not a quality guarantee.
Inspect two stage predictions
from sklearn.ensemble import GradientBoostingRegressorX = [[0], [1], [2], [3]]y = [0, 0, 4, 4]m = GradientBoostingRegressor(n_estimators=2, max_depth=1, learning_rate=0.5, random_state=7).fit(X,y)print([p.tolist() for p in m.staged_predict([[0],[3]])])Observed local output:
[[1.0, 3.0], [0.5, 3.5]]The initial mean is 2. Each stump removes half the remaining residual for these two groups.
Common mistakes
Do not average additive corrections as if they were independent full predictions. Do not interpret every raw additive classification score as a probability. Do not assume sequential learners are independent.
Practice and next steps
Starting from 8, add corrections of -4 and 6 with weight 0.25 each. Predict the intermediate and final values before checking your calculation. Complete the knowledge check and staged exercise. Next: AdaBoost weighting.
Check Your Understanding
Solidify your learning with the interactive assessment directly below this lesson.
Concept Quiz & Questions
Additive weak learners — knowledge check
Apply additive weak learners to new examples.
F0=6, h1=4, a1=0.5. What is F1?
What distinguishes boosting training from bagging?
What does a negative correction do?
What is a decision stump?
Why limit stage count?