Skip to content

Practice: Turning weak learners strong: boosting

Seven short questions. Try to answer each one before opening the collapsible.

1. What is a weak learner, and what kind of model is usually used as one?

Show answer

A model that does only a little better than chance. In boosting it is usually a very shallow tree, sometimes a single split (a stump). Weak alone, but powerful when chained in sequence.

2. State the core philosophy of boosting in one sentence.

Show answer

Build weak learners one at a time, each trained to fix the errors the previous ones still make, and add up their contributions into one strong model.

3. How does AdaBoost focus on hard examples?

Show answer

After each weak learner, it increases the weight of the examples that learner got wrong, so the next learner pays more attention to them. It also weights each learner’s vote by how accurate that learner was.

4. How does gradient boosting differ from AdaBoost in what each new tree learns?

Show answer

Instead of re-weighting examples, each new tree is trained to predict the residuals: the gap between the ensemble’s current prediction and the truth. Adding the tree shrinks the error. It is gradient descent with trees as the steps.

5. What does the learning rate do in boosting, and what is the risk if boosting runs too long?

Show answer

The learning rate scales down each tree’s contribution so the ensemble takes many small steps. The risk: unlike a forest, boosting can overfit if you add too many trees or use too large a learning rate, fitting noise and raising test error.

6. In one line each, how do bagging and boosting differ?

Show answer

Bagging (random forest): deep trees built independently in parallel, averaged, mainly cutting variance. Boosting: weak trees built in sequence, each fixing the last’s errors, mainly cutting bias.

7. Why do gradient-boosted trees matter in practice?

Show answer

They (XGBoost, LightGBM, CatBoost) are the dominant models for tabular, structured data, winning most competitions on such data and widely used in industry. “For tabular data, gradient boosting beats deep learning” refers to this family.

A gradient-boosting ensemble is closing in on a true value of 50. It starts with a guess of 40, and each tree predicts the leftover error and adds it. Fill in the running prediction and residual.

true value: 50
start: prediction 40 residual = ?
tree 1: adds +6 prediction = ? residual = ?
tree 2: adds +3 prediction = ? residual = ?
Show answer
start: prediction 40 residual = 50 - 40 = +10
tree 1: adds +6 -> prediction 46 residual = 50 - 46 = +4
tree 2: adds +3 -> prediction 49 residual = 50 - 49 = +1

The residual shrinks from 10 to 4 to 1. Each tree predicts only the error that remains, and adding it nudges the ensemble closer to 50. This is the gradient-descent picture: repeated small corrections, each one reducing the error.

Label each description as bagging (random forest) or boosting.

A. Deep trees built independently on bootstrap samples, then averaged.
B. Each new shallow tree is trained on the previous ensemble's residuals.
C. Misclassified examples get re-weighted so the next learner focuses on them.
D. Adding more trees never really hurts; it just plateaus.
Show answer
  • A: bagging. Independent, parallel, deep trees, averaged. That is a random forest.
  • B: boosting. Sequential, residual-chasing. That is gradient boosting.
  • C: boosting. Re-weighting hard examples is how AdaBoost works.
  • D: bagging. A forest cannot overfit just by adding trees; boosting can, which is the key practical difference.

The tell: independent-and-parallel means bagging; sequential-and-error-correcting means boosting.

Ten cards. Click any card to reveal the answer. Use the Print flashcards button for one card per page.

Q. What is a weak learner?
A.

A model that does only a little better than chance, usually a very shallow tree or a single-split stump. Weak alone, strong when boosted in sequence.

Q. What is the core idea of boosting?
A.

Build weak learners one at a time, each trained to fix the errors the previous ones still make, and add up their contributions into one strong model.

Q. How does AdaBoost work?
A.

It re-weights the data after each learner, increasing the weight of misclassified examples so the next learner focuses on them, and weights each learner’s vote by its accuracy.

Q. How does gradient boosting work?
A.

Each new tree predicts the residuals (the gap between the current prediction and the truth); adding it (scaled by a learning rate) shrinks the error. It is gradient descent with trees as steps.

Q. What does the learning rate do in boosting?
A.

It scales down each tree’s contribution so the ensemble takes many small steps, which generalizes better than a few big ones.

Q. Can boosting overfit?
A.

Yes. Unlike a random forest, adding too many trees or using too large a learning rate makes boosting fit noise and raise test error. It needs careful tuning.

Q. Bagging vs boosting: how are the trees built?
A.

Bagging: independently, in parallel, deep trees. Boosting: sequentially, each fixing the last’s errors, weak trees.

Q. Bagging vs boosting: which error does each mainly reduce?
A.

Bagging mainly reduces variance (by averaging). Boosting mainly reduces bias (by error-correction).

Q. Why is gradient boosting connected to gradient descent?
A.

Each new tree is a step downhill on the loss, predicting and removing leftover error. It is gradient descent where the steps are whole trees rather than parameter nudges.

Q. Which models are the gradient-boosting champions for tabular data?
A.

XGBoost, LightGBM, and CatBoost. They dominate competitions on structured data and are widely used in industry.