Tutorials › Statistical Learning (Graduate) › A Worked Comparison Of Boosting Updates And Bounds

Boosting and Margin Bounds · Tutorial 839 of 989

A Worked Comparison Of Boosting Updates And Bounds

Calculate consecutive AdaBoost updates, see how shrinkage changes margins, and evaluate a rigorous finite-sample margin bound.

Advanced 10 min read

What You'll Learn

  • Calculate the weighted error and coefficient for discrete AdaBoost rounds.
  • Normalize observation weights correctly after each update.
  • Track signed margins as ensemble coefficients are added.
  • Compare full AdaBoost steps with shrinkage.
  • Evaluate a finite-sample margin bound for a finite predictor family.
  • Identify when a margin-bound calculation does not justify generalization.

Why Compare Updates and Bounds?

Boosting calculations connect three quantities that are easy to conflate: the distribution of weights used to choose a weak rule, the coefficients accumulated in the ensemble, and the margins of individual observations. A small numerical example makes their roles visible. It also shows why a favorable training margin or a small empirical margin fraction is not, by itself, a population guarantee: a bound needs a stated sampling assumption and a way to account for which predictors were considered.

We use binary labels \(y_i\in\{-1,+1\}\) and classifiers \(h(x_i)\in\{-1,+1\}\). The signed margin of observation \(i\) under an ensemble \(F\) is \(y_iF(x_i)\). A positive margin means the ensemble score has the correct sign; a larger positive margin indicates a more confident signed score. In discrete AdaBoost, a round selects a weak rule with weighted error below one half and adds a log-odds coefficient.

Definition: Given nonnegative observation weights \(D_t(i)\) summing to one, the weighted error of a binary rule \(h_t\) is \(\epsilon_t=\sum_{i=1}^n D_t(i)\mathbf{1}\{h_t(x_i)\ne y_i\}\). For \(0<\epsilon_t<1/2\), the discrete AdaBoost coefficient is \(\alpha_t=\tfrac12\log((1-\epsilon_t)/\epsilon_t)\). With step-size multiplier \(\nu\in(0,1]\), the update is \(D_{t+1}(i)\propto D_t(i)\exp(-\nu\alpha_t y_i h_t(x_i))\), and the ensemble score gains \(\nu\alpha_t h_t\).

Worked AdaBoost Updates

Consider four observations with labels \(y=(+1,+1,-1,-1)\). To keep the update arithmetic focused, begin at a specified continuation state: the current weights are \(D_2=(1/12,1/12,3/4,1/12)\), and the existing score is \(F_1=\alpha_1h_1\), where \(\alpha_1=\tfrac12\log 3\) and \(h_1=(+1,+1,+1,-1)\). The weights and existing score are state information at the start of this calculation; they are not being inferred from a uniform initialization. We now calculate two consecutive standard, unshrunk rounds.

Worked Example: Two Consecutive Weighted Updates

In round 2, take \(h_2=(+1,-1,-1,-1)\). It misclassifies only observation 2, so its weighted error is \(\epsilon_2=D_2(2)=1/12\). Therefore \(\alpha_2=\tfrac12\log((11/12)/(1/12))=\tfrac12\log 11\approx1.1989\).

The update multiplies the erroneous observation's weight by \(e^{\alpha_2}=\sqrt{11}\), and each correct observation's weight by \(e^{-\alpha_2}=1/\sqrt{11}\). The normalizing constant is \[ Z_2=\frac{1}{12}\sqrt{11}+\frac{11}{12\sqrt{11}}=\frac{\sqrt{11}}{6}. \] Thus observation 2 has new weight \((\sqrt{11}/12)/Z_2=1/2\). The other observations retain their relative proportions \(1:9:1\), and their total weight is \(1/2\). Their normalized weights are consequently \(1/22,9/22,1/22\). In observation order, \(D_3=(1/22,1/2,9/22,1/22)\), which sums to one.

For round 3, take \(h_3=(+1,+1,+1,-1)\). Under the labels above, this rule errs only on observation 3. Its error is \(9/22\approx0.4091\), so \[ \alpha_3=\frac12\log\left(\frac{1-9/22}{9/22}\right) =\frac12\log\frac{13}{9}\approx0.1839. \]

The error observation receives weight \(1/2\) after the update. The other three keep their relative proportions \(1:11:1\), because their previous weights were \(1/22,1/2,1/22\). Their total is \(1/2\), so the updated weights are \(1/26,11/26,1/2,1/26\). They sum to one.

This is the general normalization pattern: with the log-odds coefficient, the misclassified group and correctly classified group each receive total updated weight \(1/2\). Within either group, relative weights are unchanged. The group totals are equal, but individual weights within a group need not be.

Result: For a round with \(0<\epsilon_t<1\), use the full coefficient \(\alpha_t=\tfrac12\log((1-\epsilon_t)/\epsilon_t)\) and the update \(D_{t+1}(i)=D_t(i)e^{-\alpha_ty_ih_t(x_i)}/Z_t\). Then \(Z_t=2\sqrt{\epsilon_t(1-\epsilon_t)}\), and the updated total weight on each of the correctly and incorrectly classified groups is \(1/2\).

To verify the result, write the unnormalized total for errors as \(\epsilon_t e^{\alpha_t}\), and the total for correct classifications as \((1-\epsilon_t)e^{-\alpha_t}\). The coefficient definition gives \(e^{2\alpha_t}=(1-\epsilon_t)/\epsilon_t\), hence \[ \epsilon_t e^{\alpha_t}=(1-\epsilon_t)e^{-\alpha_t} =\sqrt{\epsilon_t(1-\epsilon_t)}. \] Adding the two totals gives \(Z_t=2\sqrt{\epsilon_t(1-\epsilon_t)}\). Dividing either group total by \(Z_t\) gives \(1/2\). This also shows why a reweighting calculation must normalize the correct group in proportion to its previous weights, rather than assigning each observation an arbitrary share. \(\square\)

Margins and Shrinkage

At each round the signed margin changes by a particularly simple amount: \[ y_iF_t(x_i)=y_iF_{t-1}(x_i)+\nu\alpha_t y_i h_t(x_i). \] The increment is \(+\nu\alpha_t\) for an observation classified correctly by the new rule and \(-\nu\alpha_t\) for one classified incorrectly. Thus a weak rule can improve some margins while reducing others; the weighted error determines its coefficient, not a guarantee that every observation improves.

Worked Example: Checking the Margins After Round 3

For the continuation state above, \(y_ih_1(x_i)=(+1,+1,-1,+1)\), \(y_ih_2(x_i)=(+1,-1,+1,+1)\), and \(y_ih_3(x_i)=(+1,+1,-1,+1)\). With \(F_3=\alpha_1h_1+\alpha_2h_2+\alpha_3h_3\), add the three signed contributions for each observation:

Observation 1 has margin \(\alpha_1+\alpha_2+\alpha_3 =\tfrac12\log 3+\tfrac12\log 11+\tfrac12\log(13/9)\approx1.9321\).

Observation 2 has margin \(\alpha_1-\alpha_2+\alpha_3 =\tfrac12\log 3-\tfrac12\log 11+\tfrac12\log(13/9)\approx-0.4658\).

Observation 3 has margin \(-\alpha_1+\alpha_2-\alpha_3 =-\tfrac12\log 3+\tfrac12\log 11-\tfrac12\log(13/9)\approx0.4658\).

Observation 4 has margin \(\alpha_1+\alpha_2+\alpha_3\approx1.9321\). The four margins are therefore approximately \((1.9321,-0.4658,0.4658,1.9321)\). Observation 2 still has a negative margin: round 3's correct classification increased it by \(\alpha_3\), but did not erase its negative margin from earlier rounds.

Worked Example: Full Step Versus Shrinkage

Suppose a separate round starts with uniform weights on four observations, and a weak rule errs on exactly one. Its weighted error is \(1/4\), and its full coefficient is \(\alpha=\tfrac12\log 3\approx0.5493\). The signed margin increment is \(+\alpha\) on each correctly classified observation and \(-\alpha\) on the error.

With shrinkage \(\nu=1/2\), the score increment is instead \(\nu\alpha=\tfrac14\log3\approx0.2747\). The margin changes are \(+0.2747\) for each correct observation and \(-0.2747\) for the error. Shrinkage halves this round's margin movement; it does not change which observations this rule classifies correctly.

The corresponding shrunken weight update is proportional to \(D(i)e^{-\nu\alpha y_ih(x_i)}\). Here the unnormalized error weight is \(\tfrac14e^{\nu\alpha}\), while the total unnormalized correct weight is \(\tfrac34e^{-\nu\alpha}\). Since \(e^{\nu\alpha}=3^{1/4}\), the normalizer is \[ Z=\frac14\,3^{1/4}+\frac34\,3^{-1/4}\approx0.8989. \] The updated error weight is \((3^{1/4}/4)/Z\approx0.3660\), rather than \(1/2\). Shrinkage tempers the weight change as well as the score change; the equal-half group identity applies to the full log-odds step, not automatically to a shrunken step.

A Finite-Sample Margin Bound

A margin bound relates the population classification error to an empirical fraction of small margins, plus a sampling penalty. To give a completely explicit finite-sample result, consider a finite family of \(K\) candidate score functions, fixed before observing the sample. Each score \(F\) takes values in \([-1,1]\), and classification predicts the sign of \(F(x)\). For a threshold \(\gamma\ge0\), a small-margin observation is one for which \(yF(x)\le\gamma\). We use the tie rule that \(F(x)=0\) predicts \(+1\). The event \(\{yF(x)\le0\}\) is the nonpositive-margin event; it contains the classification-error event under this tie rule, and is contained in the small-margin event.

Theorem: Let \((X_i,Y_i)_{i=1}^n\) be independent and identically distributed observations from a distribution \(P\), with \(Y_i\in\{-1,+1\}\). Let \(\mathcal F\) be a fixed finite family of \(K\ge1\) score functions. For any fixed \(\gamma\ge0\) and \(0<\delta<1\), with probability at least \(1-\delta\) over the sample, every \(F\in\mathcal F\) satisfies \[ P\{YF(X)\le0\} \le \frac{1}{n}\sum_{i=1}^n\mathbf{1}\{Y_iF(X_i)\le\gamma\} +\sqrt{\frac{\log(K/\delta)}{2n}}. \] A right-hand side above one may be replaced by the trivial bound one.

For a proof, fix one \(F\) and define \(Z_i=\mathbf{1}\{Y_iF(X_i)\le\gamma\}\). These are independent Bernoulli random variables with common mean \(p_F=P\{YF(X)\le\gamma\}\). Hoeffding's inequality gives \[ P\left\{p_F-\frac1n\sum_{i=1}^n Z_i>s\right\}\le e^{-2ns^2}. \] Set \(s=\sqrt{\log(K/\delta)/(2n)}\); the right-hand side is \(\delta/K\). Taking a union bound over the \(K\) functions shows that, with probability at least \(1-\delta\), for every \(F\), \(p_F\le n^{-1}\sum_i Z_i+s\). Finally, \(\{YF(X)\le0\}\subseteq\{YF(X)\le\gamma\}\), so the same upper bound holds for the population error. \(\square\)

Worked Example: Evaluating the Bound

Suppose \(n=20\), the candidate family contains \(K=8\) predictors fixed in advance, and we want confidence \(1-\delta=0.95\). Choose margin threshold \(\gamma=0.2\). If the selected predictor has 3 of the 20 training margins at or below \(0.2\), its empirical small-margin fraction is \(3/20=0.15\). The penalty is \[ \sqrt{\frac{\log(8/0.05)}{2(20)}} =\sqrt{\frac{\log160}{40}} \approx\sqrt{0.1269}\approx0.3562. \] The bound gives population error at most \(0.15+0.3562=0.5062\), simultaneously for every candidate with probability at least \(0.95\). This guarantee is valid but not especially tight; small samples and a large candidate family can make the penalty substantial.

Common Pitfalls and Interpretation

  • Forgetting to renormalize a group. After an update, the correct group has total weight \(1/2\), distributed according to its previous relative weights. In the round-2 calculation, the correct weights \(1/12,3/4,1/12\) have relative proportions \(1:9:1\), so their new values are \(1/22,9/22,1/22\), not values obtained by dividing each by 20. Always check that all updated weights sum to one.
  • Using the wrong distribution for the next error. The round-3 error is evaluated under \(D_3\), so it is \(9/22\approx0.4091\), not a weight from an earlier round. Its coefficient is \(\tfrac12\log(13/9)\approx0.1839\).
  • Assuming all margins increase. The margin increment's sign is determined by whether that round's rule is correct on that observation. A later correct rule can improve a negative margin without making it positive.
  • Applying a fixed-predictor bound after unrestricted selection. The theorem pays for a finite family considered uniformly. If the predictor is selected from a family not included in that count, or from an unrestricted class, this calculation alone does not justify the claimed guarantee. A suitable complexity-controlled bound is then needed.

The practical lesson is to keep the three calculations separate and then connect them deliberately: weighted error determines a round's coefficient, the signed rule output determines each margin change, and the generalization statement needs an explicit sampling model and predictor family. A small empirical margin fraction is informative, but it is not a population statement until the bound's assumptions and penalty are accounted for.

Check Your Understanding

Use the update identities and the stated assumptions to answer each question.

  1. If a rule has weighted error \(1/5\), what is its full discrete AdaBoost coefficient?
  2. Why do the corrected observations in round 2 receive weights \(1/22,9/22,1/22\), rather than \(1/20,9/20,1/20\)?
  3. For an observation misclassified by a round, what is its signed-margin increment under step size \(\nu\)?
  4. In the finite-family bound, how does increasing \(K\) affect the penalty, all else equal?
  5. Why does a bound for a fixed finite candidate family not automatically cover a predictor selected from an unrestricted class?
Clinical Biostats