Classical machine learningML 08
Gradient Boosting
A random forest grows its trees independently and averages them. Boosting grows them one after another, each one aimed at what the model so far still gets wrong. It starts from the average, fits a small tree to the errors (the residuals), adds a fraction of that tree to the model, and repeats. Each step only nudges the curve, but hundreds of small corrections add up to a flexible, accurate model. Gradient-boosted trees (in libraries such as XGBoost and LightGBM) win many prediction competitions on tabular data. Step through one tree at a time to see each correction, or press play. The data are fictional.
Model
Error as trees are added
each tree is a step function: one split (depth 1, a “stump”) gives two levels, depth 2 gives up to four · while trees are added quickly, the curve eases smoothly instead of jumping
Why “gradient”?
For squared error, the residuals are exactly the direction in which each prediction should move to reduce the loss: the negative gradient. Friedman (2001) developed the view, also reached by Breiman (1997) and Mason et al. (2000), that boosting is gradient descent, carried out not on a handful of parameters but on the predictions themselves, with each tree as one step. Swapping in a different loss gives boosting for other tasks: log-loss for classification (fitting probabilities, as logistic regression does), or absolute error for data with outliers. Earlier boosting methods such as AdaBoost (Freund & Schapire, 1997) reweighted the misclassified points instead.
Learning rate, depth and when to stop
Adding only a fraction of each tree (the learning rate, or shrinkage) makes progress slower but smoother, and usually ends more accurate: with a learning rate of 1 the model chases the noise within a few trees. Deeper trees capture interactions between features but overfit sooner. Unlike a random forest, boosting can overfit if it runs too long, since each tree fits a little more of the remaining noise: hold out a test set and watch the test error flatten and then creep up while the training error keeps falling. In practice the number of trees is chosen by stopping when the error on held-out data stops improving.
References
- Breiman, L. (1997). Arcing the edge. Technical Report 486, Department of Statistics, University of California, Berkeley.
- Mason, L., Baxter, J., Bartlett, P. L., & Frean, M. (2000). Boosting algorithms as gradient descent. In Advances in Neural Information Processing Systems 12 (pp. 512–518). MIT Press.
- Friedman, J. H. (2001). Greedy function approximation: a gradient boosting machine. The Annals of Statistics, 29(5), 1189–1232. doi.org/10.1214/aos/1013203451
- Freund, Y., & Schapire, R. E. (1997). A decision-theoretic generalization of on-line learning and an application to boosting. Journal of Computer and System Sciences, 55(1), 119–139. doi.org/10.1006/jcss.1997.1504
- Chen, T., & Guestrin, C. (2016). XGBoost: a scalable tree boosting system. In Proceedings of the 22nd ACM SIGKDD International Conference on Knowledge Discovery and Data Mining (pp. 785–794). doi.org/10.1145/2939672.2939785