{"word_count": 669, "character_count": 6072}
This post is the seventh one of our series on the history and foundations of econometric and machine learning models. The first fours were on econometrics techniques. Part 6 is online here.Boosting and sequential learningAs we have seen before, modelling here is based on solving an optimization problem, and solving the problem described by equation [latex](6) [/latex] is all the more complex because the functional space [latex]\mathcal{M}[/latex] is large. The idea of boosting, as introduced by Shapire &#38; Freund (2012), is to learn, slowly, from the errors of the model, in an iterative way. In the first step, we estimate a model [latex]m_1[/latex] for [latex]y[/latex], from [latex]\mathbf{X}[/latex], which will give an error [latex]\varepsilon_1[/latex]. In the second step, we estimate a model [latex]m_2[/latex] for [latex]\varepsilon_1[/latex], from [latex]X[/latex], which will give an error [latex]\varepsilon_2[/latex], etc. We will then retain as a model, after [latex]k[/latex] iterations [latex display="true"]m^{(k)}(\cdot)=\underbrace{m_1(\cdot)}_{\sim y}+\underbrace{m_2(\cdot)}_{\sim \epsilon_1}+\underbrace{m_3(\cdot)}_{\sim \epsilon_2}+\cdots+\underbrace{m_k(\cdot)}_{\sim \epsilon_{k-1}}=m^{(k-1)}(\cdot)+m_k(\cdot)~~~(7)[/latex]Here, the error [latex]\varepsilon[/latex] is seen as the difference between [latex]y[/latex] and the model [latex]m(\mathbf{x})[/latex], but it can also be seen as the gradient associated with the quadratic loss function. Formally, [latex]\varepsilon[/latex] can be seen as [latex] \nabla\ell[/latex] in a more general context (here we find an interpretation that reminds us of residuals in generalized linear models).Equation [latex] (7) [/latex] can be seen as a descent of the gradient, but written in a dual way. The problem will then be rewritten as an optimization problem: [latex display="true"]m^{(k)}=m^{(k-1)}+\underset{h\in\mathcal{H}}{\text{argmin}}\left\lbrace \sum_{i=1}^n \ell(\underbrace{y_i-m^{(k-1)}(\boldsymbol{x}_i)}_{\varepsilon_{k,i}},h(\boldsymbol{x}_i))\right\rbrace~~~(8)[/latex]where the trick is to consider a relatively simple space [latex]\mathcal{H}[/latex] (we will speak of "weak learner"). Classically, [latex]\mathcal{H}[/latex] functions are step-functions (which will be found in classification and regression trees) called "stumps". To ensure that learning is indeed slow, it is not uncommon to use a shrinkage parameter, and instead of setting, for example, [latex]\varepsilon_1=y-m_1 (\mathbf{x})[/latex], we will set [latex]\varepsilon_1=y-\alpha\cdot m_1 (\mathbf{x})[/latex] with [latex]\alpha\in[0.1][/latex]. It should be noted that it is because a non-linear space is used for [latex]\mathcal{H}[/latex], and learning is slow, that this algorithm works well. In the case of the Gaussian linear model, remember that the residuals [latex]\varepsilon=y-\mathbf{x}^T\beta[/latex] are orthogonal to the explanatory variables, [latex]\mathbf{X}[/latex], and it is then impossible to learn from our errors. The main difficulty is to stop in time, because after too many iterations, it is no longer the m function that is approximated, but the noise. This problem is called overlearning.This presentation has the advantage of having a heuristic reminiscent of an econometric model, by iteratively modelling the residuals by a (very) simple model. But this is often not the presentation used in the learning literature, which places more emphasis on an optimization algorithm heuristic (and gradient approximation). The function is learned iteratively, starting from a constant value, [latex display="true"]m^{(0)}=\underset{m\in\mathbb{R}}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,m)\right\rbrace[/latex]then we consider the following learning procedure[latex display="true"]{\displaystyle m^{(k)}=m^{(k-1)}+{\underset{h\in {\mathcal {H}}}{\text{argmin}}}\sum _{i=1}^{n}\ell(y_{i},m^{(k-1)}(\mathbf{x}_{i})+h(\mathbf{x}_{i}))}~~~(9)[/latex]which can be written, if [latex]\mathcal{H}[/latex] is a set of differentiable functions,[latex display="true"] {\displaystyle m^{(k)}=m^{(k-1)}-\gamma_{k}\sum _{i=1}^{n}\nabla _{m^{(k-1)}}\ell(y_{i},m^{(k-1)}(\mathbf{x}_{i})),} [/latex]where [latex display="true"]{\displaystyle \gamma _{k}=\underset{\gamma }{\text{argmin }}\sum _{i=1}^{n}\ell\left(y_{i},m^{(k-1)}( \mathbf{x}_{i})-\gamma \nabla _{m^{(k-1)}}\ell(y_{i},m^{(k-1)}( \mathbf{x}_{i}))\right).} [/latex]To better understand the relationship with the approach described above, at step [latex]k[/latex], pseudo-residuals are defined by setting [latex display="true"]r_{i,k}=-\left.\frac{\partial \ell(y_i,m(\mathbf{x}_i))}{\partial m(\mathbf{x}_i)}\right\vert_{m(\mathbf{x})=m^{(k-1)}( \mathbf{x})}\text{ where }i=1,\cdots,n[/latex]A simple model is then sought to explain these pseudo-residuals according to the explanatory variables [latex]\mathbf{x}_i[/latex], i.e. [latex]r_{i,k}=h^\star(\mathbf{x}_i) [/latex], where [latex]h^\star\in\mathcal{H}[/latex]. In a second step, we look for an optimal multiplier by solving[latex display="true"]\gamma_k = \underset{\gamma\in\mathbb{R}}{\text{argmin}}\left\lbrace\sum_{i=1}^n \ell(y_i,m^{(k-1)}( \mathbf{x}_i)+\gamma h^\star(\mathbf{x}_i))\right\rbrace [/latex]then update the model by setting [latex display="true"]m_k (\cdot)=m_(k-1) (\cdot)+\gamma_k h^\star (\cdot) [/latex]. More formally, we move from equation [latex] (8) [/latex] - which clearly shows that we are building a model on residuals - to equation [latex] (9) [/latex] - which will then be translated as a gradient calculation problem - noting that [latex]\ell(y,m+h)=\ell(y-m,h) [/latex]. Classically, class [latex]\mathcal{H}[/latex] of functions consists in regression trees. It is also possible to use a form of penalty by setting [latex]m_k (\cdot)=m_(k-1) (\cdot)+\nu\gamma_k h^\star (\cdot) [/latex], with [latex]\nu\in(0,1) [/latex]. But let's go back  a little further – in our next post – on the importance of penalization before discussing the numerical aspects of optimization.To be continued (keep in mind that references are online here)…