Boosting
Study guides: Exam SRM, Exam PA, Exam MAS-II, Exam ACIA-CAPSTONE
Boosting is a method that grows decision trees sequentially, each small tree fitted to the residuals of the model so far, and adds a shrunken version of each to the model. The boosted model is
\hat{f}(x) = \sum_{b=1}^{B}\lambda\hat{f}^{b}(x)
\hat{f}^{b}is thebth tree.\lambdais the shrinkage parameter, or learning rate, a small positive number.
The model's prediction is the sum of the trees' predictions, each multiplied by \lambda. Shrinking each tree makes the model learn slowly, and many small corrections fit better than one large one. Where bagging fits independent trees to reduce variance, boosting reduces bias.
A boosted model with
\lambda = 0.1has two trees, which predict50and30at a pointx. What does the model predict there?
- Each tree contributes
\lambdatimes its prediction:0.1(50) = 5and0.1(30) = 3.\hat{f}(x) = 5 + 3 = 8.
Boosting regression trees
The algorithm for regression trees (James et al., Algorithm 8.2) is:
- Set
\hat{f}(x) = 0andr_i = y_ifor every training observation, so the first tree is fitted to the responses themselves. - For
b = 1, \ldots, B, fit a tree\hat{f}^{b}withdsplits to the data(X, r), then update the model and the residuals. - Output the boosted model
\hat{f}(x) = \sum_{b=1}^{B}\lambda\hat{f}^{b}(x).
The update after tree b is
\hat{f}(x) \leftarrow \hat{f}(x) + \lambda \hat{f}^{b}(x)
r_i \leftarrow r_i - \lambda \hat{f}^{b}(x_i)
There is no bootstrap sampling: each tree is fitted to the full data with the updated residuals as the response.
An observation has
y = 20. With\lambda = 0.1, the first tree predicts18for it and the second, fitted to the residuals, predicts15. What is its residual after two trees?
- The first residual is
r = 20.- After the first tree,
r = 20 - 0.1(18) = 18.2.- After the second,
r = 18.2 - 0.1(15) = 16.7.
Tuning parameters
| Parameter | Meaning | Typical |
|---|---|---|
B |
number of trees | chosen by Cross-Validation |
\lambda |
shrinkage, or learning rate | 0.01 or 0.001; a smaller \lambda needs a larger B |
d |
number of splits in each tree, the interaction depth | often 1 to 4 |
With d = 1 each tree is a stump, and the model is additive. A depth of d allows interactions of up to d predictors. Unlike bagging and random forests, boosting can overfit if B is too large, because each added tree keeps fitting the residuals. Because it learns slowly, its test error can keep falling over many trees and end below that of bagging and random forests.
A boosted model with
\lambda = 0.01andd = 2has training error still falling atB = 5000, but cross-validation error lowest atB = 1200and rising after. How many trees should be used?
- Beyond
1{,}200trees, the added trees fit noise in the residuals.- The model should use
B = 1{,}200, the minimum of the cross-validation error.