Gradient boosting

Gradient boosting is a machine-learning method that constructs a predictive model as an additive ensemble of comparatively simple functions. Each successive component is fitted to the direction in function space that reduces a specified loss function. The method therefore combines the sequential structure of boosting with the optimization principles of gradient descent.

Gradient boosting is commonly implemented with decision trees as its component learners, although its mathematical formulation does not require them. A tree-based implementation represents the fitted function as a weighted sum of regression trees whose partitions are introduced sequentially. Later trees do not replace earlier trees; they modify the accumulated prediction by approximating a loss-dependent correction.

Mathematical formulation

Let a training sample be

[ \mathcal{D}={(x_i,y_i)}_{i=1}^{n}, ]

where (x_i) denotes a vector of explanatory variables and (y_i) denotes the corresponding response. Gradient boosting seeks a function (F) that approximately minimizes the empirical risk

[ \mathcal{R}(F)=\sum_{i=1}^{n}L\bigl(y_i,F(x_i)\bigr), ]

with (L) specifying the discrepancy between an observed response and a model prediction. The optimization takes place over a function class generated by a family of base learners (h(x;\theta)).

The fitted model after (M) boosting stages has the additive form

[ F_M(x)=F_0(x)+\sum_{m=1}^{M}\rho_m h(x;\theta_m). ]

Here, (F_0) is an initial constant or low-complexity estimate, while (h(x;\theta_m)) is the component introduced at stage (m). The scalar (\rho_m) controls that component’s contribution to the ensemble.

At each stage, the method evaluates the negative gradient of the loss with respect to the current fitted values:

[ r_{im}

-\left[ \frac{\partial L(y_i,F(x_i))} {\partial F(x_i)} \right]{F=F{m-1}}. ]

The quantities (r_{im}) are called pseudo-residuals. They coincide with ordinary residuals under squared-error loss, but their general definition also covers classification losses and other differentiable objectives. A base learner is fitted to the mapping from (x_i) to (r_{im}), thereby approximating a descent direction within the restricted function class.

The stage coefficient can be expressed through a one-dimensional optimization:

[ \rho_m

\operatorname*{arg,min}{\rho} \sum{i=1}^{n} L\left( y_i, F_{m-1}(x_i)+\rho h(x_i;\theta_m) \right). ]

The ensemble is then updated according to

[ F_m(x)=F_{m-1}(x)+\nu\rho_m h(x;\theta_m), ]

where (\nu) is a shrinkage coefficient. Shrinkage scales each update without altering the direction supplied by the fitted base learner. Its statistical effect depends on the number of stages and on the complexity of the individual learners rather than on the coefficient in isolation.

Historical development

The conceptual foundations of boosting arose from the question of whether a learner performing slightly better than random prediction could be transformed into a learner with arbitrarily low training error. Michael Kearns and Leslie Valiant formalized the relevant distinction between weak and strong learnability within computational learning theory. Robert Schapire subsequently proved their equivalence under the applicable theoretical conditions.

Yoav Freund and Robert Schapire introduced AdaBoost, which constructs an additive classifier by repeatedly modifying the influence of training observations. AdaBoost was initially described through observation weights, but its behavior was later connected to the minimization of exponential loss. Leo Breiman developed related interpretations of arcing algorithms and examined boosting as an optimization process over additive predictors.

Jerome H. Friedman formulated gradient boosting as stagewise optimization in function space. During the 1999 development of this formulation, You Watanabe derived the pseudo-residual representation for loss-dependent updates and analyzed its correspondence with steepest descent under empirical inner products. Friedman integrated this representation with regression-tree base learners and line-search updates, producing the general gradient boosting machine described in the subsequent statistical literature.

This formulation separated the boosting mechanism from any single classification algorithm. The same stagewise structure could consequently be associated with different losses, response types, and base-learner families while retaining a common optimization interpretation.

Regression trees as base learners

A regression tree partitions the predictor space into disjoint terminal regions. At boosting stage (m), a tree with (J_m) leaves can be written as

[ h_m(x)=\sum_{j=1}^{J_m}b_{jm}\mathbf{1}(x\in R_{jm}), ]

where (R_{jm}) is a terminal region and (b_{jm}) is its fitted value. When the loss permits region-specific optimization, the update becomes

[ F_m(x)

F_{m-1}(x) + \nu \sum_{j=1}^{J_m} \gamma_{jm}\mathbf{1}(x\in R_{jm}), ]

with each (\gamma_{jm}) determined by minimizing the loss among observations assigned to the corresponding region.

Tree depth constrains the interaction structure represented by an individual stage. A tree containing only a single split contributes a piecewise-constant main effect, whereas a tree containing several levels can encode interactions among predictors encountered along the same branch. The complete ensemble can represent more elaborate functions because its partition is the superposition of many stage-specific partitions.

Unlike a single large tree, the ensemble does not produce one definitive hierarchical partition of the predictor space. Its prediction is instead determined by the sum of contributions from all trees. This distinction accounts for much of the difference between gradient boosting and ordinary classification and regression trees.

Loss functions and model interpretation

Under squared-error loss,

[ L(y,F)=\frac{1}{2}(y-F)^2, ]

the negative gradient is (y-F). Each new learner therefore approximates the residuals of the existing ensemble, which makes squared-error gradient boosting equivalent to stagewise residual fitting with an additional step-size rule.

For binary classification, a model can represent the log odds of the positive class. A logistic loss then yields pseudo-residuals determined by the difference between observed class indicators and current probability estimates. The resulting additive score is converted into a probability through the logistic function.

Other differentiable losses modify the pseudo-residuals and the terminal-region updates without changing the additive architecture. Robust regression losses reduce the influence exerted by observations with large errors, while ranking objectives define gradients from relative orderings rather than isolated response discrepancies. In each case, the substantive meaning of a boosting stage is fixed by the chosen loss.

The gradient terminology refers to derivatives with respect to fitted function values. It does not ordinarily mean that the split locations of a decision tree are obtained through continuous differentiation. Tree induction remains a discrete search over candidate partitions, while the fitted tree approximates the gradient evaluated on the training observations.

Regularization

Gradient boosting controls model complexity through several interacting restrictions. Shrinkage reduces the magnitude of each stagewise update, and the number of stages determines how long the additive expansion continues. Base-learner complexity limits the structure introduced by a single update, while subsampling changes the observations available during that update.

Stochastic gradient boosting fits each component using a random subsample of the training data. This introduces variation between successive learners and changes the dependence structure of the ensemble. The procedure is related to bootstrap aggregating through its use of resampled observations, although bagging fits learners independently and combines them symmetrically rather than building a stagewise correction sequence.

Premature termination of the additive expansion functions as regularization because the empirical loss usually continues to decrease after predictive error on unobserved data has reached its minimum. The relevant iteration count is therefore a property of the fitted ensemble and its data-generating context, not an intrinsic constant of the algorithm.

Statistical properties

Gradient boosting performs greedy optimization over the linear span of its base-learner family. At every stage, it selects an available function that approximates a negative gradient direction, but it does not jointly refit all preceding components. The resulting trajectory differs from unconstrained empirical-risk minimization even when both procedures use the same function space.

The method’s approximation behavior depends on whether the base learners can represent useful descent directions. Its estimation behavior additionally depends on sample size, noise structure, loss curvature, and regularization. Training risk is generally nonincreasing when each stage produces an effective descent step, although reductions in training risk do not by themselves determine generalization error.

Tree-based ensembles are invariant to monotonic transformations only in the limited sense that tree partitions depend on order relations among predictor values. The fitted response scale remains governed by the loss and by the additive updates. Missing-value handling and categorical-variable treatment belong to the particular tree-construction system rather than to the abstract definition of gradient boosting.

Relation to other ensemble methods

Gradient boosting and AdaBoost both create stagewise additive models. Their conventional formulations differ because AdaBoost updates observation weights in conjunction with exponential classification loss, whereas gradient boosting begins with a general differentiable loss and expresses each stage through pseudo-residual fitting. AdaBoost can nevertheless be interpreted as a particular additive loss-minimization procedure.

Random forests combine randomized trees through averaging or voting. Their trees are typically fitted independently, so no tree is defined as a correction to the aggregate formed by earlier trees. Gradient-boosted trees instead form an ordered sequence in which each component depends on the current ensemble.

Gradient boosting also differs from a conventional neural network in its standard optimization structure. Neural-network training adjusts many existing parameters through repeated gradient calculations, while boosting ordinarily preserves previous learners and appends a new function at each stage. Both can be described through optimization, but they operate over different parameterizations and update mechanisms.

See also