Gradient boosting is a machine learning technique based on boosting in a functional space, where the target is pseudo-residuals instead of residuals as in traditional boosting. It gives a prediction model in the form of an ensemble of weak prediction models, i.e., models that make very few assumptions about the data, which are typically simple decision trees. When a decision tree is the weak learner, the resulting algorithm is called gradient-boosted trees; it usually outperforms random forest. As with other boosting methods, a gradient-boosted trees model is built in stages, but it generalizes the other methods by allowing optimization of an arbitrary differentiable loss function.
History The idea of gradient boosting originated in the observation by Leo Breiman that boosting can be interpreted as an optimization algorithm on a suitable cost function. Explicit regression gradient boosting algorithms were subsequently developed, by Jerome H. Friedman, (in 1999 and later in 2001) simultaneously with the more general functional gradient boosting perspective of Llew Mason, Jonathan Baxter, Peter Bartlett and Marcus Frean. The latter two papers introduced the view of boosting algorithms as iterative functional gradient descent algorithms. That is, algorithms that optimize a cost function over function space by iteratively choosing a function (weak hypothesis) that points in the negative gradient direction. This functional gradient view of boosting has led to the development of boosting algorithms in many areas of machine learning and statistics beyond regression and classification.
Informal introduction (This section follows the exposition by Cheng Li.) Like other boosting methods, gradient boosting combines weak "learners" into a single strong learner iteratively. It is easiest to explain in the least-squares regression setting, where the goal is to teach a model F to predict values of the form ŷ=F(x) by minimizing the mean squared error 1n∑i(ŷi−yi)2, where i indexes over some training set of size n of actual values of the output variable y:
ŷi= the predicted value F(xi) yi= the observed value n= the size of the sample, i.e. the number of observations in y If the algorithm has M stages, at each stage m (1≤m≤M), suppose some imperfect model Fm (for low m, this model may simply predict ŷi to be y¯, the mean of y). In order to improve Fm, our algorithm should add some new estimator, hm(x). Thus,
Fm+1(xi)=Fm(xi)+hm(xi)=yi or, equivalently,
hm(xi)=yi−Fm(xi). Therefore, gradient boosting will fit hm to the residual yi−Fm(xi). As in other boosting variants, each Fm+1 attempts to correct the errors of its predecessor Fm. A generalization of this idea to loss functions other than squared error, and to classification and ranking problems, follows from the observation that residuals hm(xi) for a given model are proportional to the negative gradients of the mean squared error (MSE) loss function (with respect to F(xi)):
LMSE=1n∑i=1n(yi−F(xi))2 −∂LMSE∂F(xi)=2n(yi−F(xi))=2nhm(xi). So, gradient boosting could be generalized to a gradient descent algorithm by plugging in a different loss and its gradient.
Algorithm Many supervised learning problems involve an output variable y and a vector of input variables x, related to each other with some probabilistic distribution. The goal is to find some function F̂(x) that best approximates the output variable from the values of input variables. This is formalized by introducing some loss function L(y,F(x)) and minimizing it in expectation:
F̂=argminF𝔼x,y[L(y,F(x))]. The gradient boosting method assumes a real-valued y. It seeks an approximation F̂(x) in the form of a weighted sum of M functions hm(x) from some class ℋ, called base (or weak) learners:
F̂(x)=∑m=1Mγmhm(x)+const, where γm is the weight at stage m. We are usually given a training set {(x1,y1),…,(xn,yn)} of known values of x and corresponding values of y. In accordance with the empirical risk minimization principle, the method tries to find an approximation F̂(x) that minimizes the average value of the loss function on the training set, i.e., minimizes the empirical risk. It does so by starting with a model, consisting of a constant function F0(x), and incrementally expands it in a greedy fashion:
F0(x)=argminh0∈ℋ∑i=1nL(yi,h0(xi)), Fm(x)=Fm−1(x)+(argminhm∈ℋ[∑i=1nL(yi,Fm−1(xi)+hm(xi))])(x), for m≥1, where hm∈ℋ is a base learner function. Unfortunately, choosing the best function hm at each step for an arbitrary loss function L is a computationally infeasible optimization problem in general. Therefore, we restrict our approach to a simplified version of the problem. The idea is to apply a steepest descent step to this minimization problem (functional gradient descent). The basic idea is to find a local minimum of the loss function by iterating on Fm−1(x). In fact, the local maximum-descent direction of the loss function is the negative gradient. Hence, moving a small amount γ such that the linear approximation remains valid:
Fm(x)=Fm−1(x)−γ∑i=1n∇Fm−1L(yi,Fm−1(xi)) where γ>0. For small γ, this implies that L(yi,Fm(xi))≤L(yi,Fm−1(xi)).
Furthermore, we can optimize γ by finding the γ value for which the loss function has a minimum:
γm=argminγ∑i=1nL(yi,Fm(xi))=argminγ∑i=1nL(yi,Fm−1(xi)−γ∇Fm−1L(yi,Fm−1(xi))). If we considered the continuous case, i.e., where ℋ is the set of arbitrary differentiable functions on ℝ, we would update the model in accordance with the following equations
Fm(x)=Fm−1(x)−γm∑i=1n∇Fm−1L(yi,Fm−1(xi)) where γm is the step length, defined as γm=argminγ∑i=1nL(yi,Fm−1(xi)−γ∇Fm−1L(yi,Fm−1(xi))). In the discrete case however, i.e. when the set ℋ is finite, we choose the candidate function h closest to the gradient of L for which the coefficient γ may then be calculated with the aid of line search on the above equations. Note that this approach is a heuristic and therefore doesn't yield an exact solution to the given problem, but rather an approximation. In pseudocode, the generic gradient boosting method is:
… excerpt ends here. Continue reading the full article.