Tutorials › Statistical Learning (Graduate) › Deriving The Discrete AdaBoost Update

Boosting and Margin Bounds · Tutorial 816 of 989

Deriving The Discrete AdaBoost Update

See how a one-dimensional loss minimization determines AdaBoost’s coefficient and its normalized update of example weights.

Advanced 10 min read

What You'll Learn

  • Define weighted exponential loss for a binary rule and a current distribution of example weights.
  • Derive the minimizing coefficient from the weighted error.
  • Distinguish finite minimizers from the endpoint cases with zero or unit error.
  • Derive the normalized example-weight update and verify its class totals.
  • Interpret the update correctly when the rule is weak, tied, or reversed.

One Rule, One Coefficient

At a boosting round, the current weights specify how strongly each training example contributes to the next update. For a candidate binary rule, its weighted error determines the coefficient that minimizes exponential loss along that rule. The derivation is a one-dimensional optimization, but it has an important qualification: if the rule is worse than chance under the current weights, the minimizing coefficient is negative. Thus, the claim that the update emphasizes errors applies to a rule with weighted error below one half, not to every binary rule.

Suppose the training data are \((x_i,y_i)\), \(i=1,\ldots,n\), with labels \(y_i\in\{-1,+1\}\). At the round under consideration, let \(D(i)\geq 0\) be the weight on example \(i\), with \(\sum_{i=1}^n D(i)=1\). A binary rule \(h\) takes values in \(\{-1,+1\}\). It classifies example \(i\) correctly when \(y_i h(x_i)=+1\), and incorrectly when \(y_i h(x_i)=-1\).

Definition: The weighted error of \(h\) is \(\epsilon=\sum_{i=1}^n D(i)\mathbf{1}\{y_i h(x_i)=-1\}\). For a coefficient \(\alpha\in\mathbb{R}\), the weighted exponential loss along \(h\) is \(Z(\alpha)=\sum_{i=1}^n D(i)\exp(-\alpha y_i h(x_i))\). The normalized example-weight update, when \(Z(\alpha)>0\), is \(D'(i)=D(i)\exp(-\alpha y_i h(x_i))/Z(\alpha)\).

The weight distribution is normalized, so the weighted mass of correctly classified examples is \(1-\epsilon\), while the mass of incorrectly classified examples is \(\epsilon\). Since the signed prediction \(y_i h(x_i)\) is \(+1\) on correct examples and \(-1\) on incorrect ones, the loss reduces to

$$ Z(\alpha)=(1-\epsilon)e^{-\alpha}+\epsilon e^{\alpha}. $$

This reduction is why the coefficient depends on the rule through its weighted error alone. The individual weights still matter for the example-by-example update, but not for minimizing this one-dimensional loss.

Deriving the Minimizing Coefficient

Theorem: If \(0<\epsilon<1\), the unique minimizer of \(Z(\alpha)=(1-\epsilon)e^{-\alpha}+\epsilon e^\alpha\) over \(\alpha\in\mathbb{R}\) is \(\alpha^*=\frac{1}{2}\log\!\left(\frac{1-\epsilon}{\epsilon}\right)\). The minimum is \(Z(\alpha^*)=2\sqrt{\epsilon(1-\epsilon)}\). If \(\epsilon=0\), the loss has infimum \(0\), approached as \(\alpha\to+\infty\), but no finite minimizer. If \(\epsilon=1\), its infimum \(0\) is approached as \(\alpha\to-\infty\), but is not attained at a finite coefficient.

Proof. For \(0<\epsilon<1\), differentiate:

$$ Z'(\alpha)=-(1-\epsilon)e^{-\alpha}+\epsilon e^\alpha, \qquad Z''(\alpha)=(1-\epsilon)e^{-\alpha}+\epsilon e^\alpha. $$

Both terms in \(Z''(\alpha)\) are positive for every finite \(\alpha\), so \(Z''(\alpha)>0\) and \(Z\) is strictly convex. A stationary point therefore is the unique global minimizer. Setting the first derivative to zero gives

$$ \epsilon e^\alpha=(1-\epsilon)e^{-\alpha} \quad\Longleftrightarrow\quad e^{2\alpha}=\frac{1-\epsilon}{\epsilon} \quad\Longleftrightarrow\quad \alpha^*=\frac{1}{2}\log\!\left(\frac{1-\epsilon}{\epsilon}\right). $$

Substituting this value yields \(e^{\alpha^*}=\sqrt{(1-\epsilon)/\epsilon}\) and \(e^{-\alpha^*}=\sqrt{\epsilon/(1-\epsilon)}\). Consequently,

$$ Z(\alpha^*)=(1-\epsilon)\sqrt{\frac{\epsilon}{1-\epsilon}} +\epsilon\sqrt{\frac{1-\epsilon}{\epsilon}} =2\sqrt{\epsilon(1-\epsilon)}. $$

At \(\epsilon=0\), \(Z(\alpha)=e^{-\alpha}\), which is positive at every finite \(\alpha\) and tends to zero as \(\alpha\to+\infty\). At \(\epsilon=1\), \(Z(\alpha)=e^\alpha\), which tends to zero as \(\alpha\to-\infty\) and is positive for every finite \(\alpha\). These facts establish the two endpoint claims. \(\square\)

The minimizer is positive when \(0<\epsilon<1/2\), zero when \(\epsilon=1/2\), and negative when \(1/2<\epsilon<1\). If the weighted edge is written as \(\gamma=1-2\epsilon\), then, for \(-1<\gamma<1\), the same expression is \(\alpha^*=\frac12\log((1+\gamma)/(1-\gamma))\). The error form makes the endpoint and above-chance distinctions explicit.

Worked Example: A Rule With Error Below One Half

Suppose four examples have weights \(0.10, 0.20, 0.30, 0.40\), respectively, and the rule misclassifies the second and fourth examples. The weights sum to \(1\), and the weighted error is \(\epsilon=0.20+0.40=0.60\), which is not below one half. To keep the arithmetic transparent while illustrating a good rule, instead suppose it misclassifies the first and second examples. Then \(\epsilon=0.10+0.20=0.30\), and the correct mass is \(0.30+0.40=0.70\).

The minimizing coefficient and loss are

$$ \alpha^*=\frac12\log\!\left(\frac{0.70}{0.30}\right) =\frac12\log\!\left(\frac73\right)\approx 0.42365, \qquad Z(\alpha^*)=2\sqrt{0.70(0.30)}\approx 0.91652. $$

Each incorrect example is multiplied before normalization by \(e^{\alpha^*}=\sqrt{7/3}\approx1.5275\); each correct example is multiplied by \(e^{-\alpha^*}=\sqrt{3/7}\approx0.6547\). For example, the first updated weight is \(0.10(1.5275)/0.91652\approx0.1667\), and the third updated weight is \(0.30(0.6547)/0.91652\approx0.2143\). The two incorrect examples together receive updated mass \(0.30(1.5275)/0.91652=0.50\), and the two correct examples receive \(0.70(0.6547)/0.91652=0.50\), up to rounding.

The Normalized Example-Weight Update

For a finite minimizing coefficient with \(0<\epsilon<1\), substitute the optimal coefficient into the update definition. An incorrect example has \(y_i h(x_i)=-1\), so its multiplier is \(e^{\alpha^*}\). A correct example has \(y_i h(x_i)=+1\), so its multiplier is \(e^{-\alpha^*}\). The following result gives the normalized update in full.

Result: For \(0<\epsilon<1\), the minimizing update is \(D'(i)=D(i)e^{-\alpha^* y_i h(x_i)}/Z(\alpha^*)\), where \(\alpha^*=\frac12\log((1-\epsilon)/\epsilon)\) and \(Z(\alpha^*)=2\sqrt{\epsilon(1-\epsilon)}\). The updated total weight on the incorrect examples is \(1/2\), and the updated total weight on the correct examples is \(1/2\).

Proof. Sum the updated weights over the incorrect examples. Their unnormalized total is \(\epsilon e^{\alpha^*}\). Using \(e^{\alpha^*}=\sqrt{(1-\epsilon)/\epsilon}\), this total is \(\sqrt{\epsilon(1-\epsilon)}\). Divide by \(Z(\alpha^*)=2\sqrt{\epsilon(1-\epsilon)}\) to obtain \(1/2\). For the correct examples, the unnormalized total is \((1-\epsilon)e^{-\alpha^*}=\sqrt{\epsilon(1-\epsilon)}\); division by the same normalizer also gives \(1/2\). The two totals sum to one, as required for a probability distribution. \(\square\)

When \(0<\epsilon<1/2\), the incorrect examples have a larger multiplier than the correct examples: \(e^{\alpha^*}>e^{-\alpha^*}\). Thus their relative weights rise, while correct examples’ relative weights fall, and the total mass of each group becomes one half. When \(1/2<\epsilon<1\), the coefficient is negative, so \(e^{\alpha^*}<e^{-\alpha^*}\): the correct examples receive the larger multiplier. The normalized group totals are still one half each. At \(\epsilon=1/2\), \(\alpha^*=0\), \(Z(\alpha^*)=1\), and the update leaves every weight unchanged.

Worked Example: A Reversed Rule With Error 0.75

Suppose a rule has weighted error \(\epsilon=0.75\), so the correct mass is \(0.25\). Its minimizing coefficient is

$$ \alpha^*=\frac12\log\!\left(\frac{0.25}{0.75}\right) =-\frac12\log 3. $$

The error multiplier is \(e^{\alpha^*}=1/\sqrt{3}\), while the correct-example multiplier is \(e^{-\alpha^*}=\sqrt{3}\). The normalizer is

$$ Z(\alpha^*)=0.75\left(\frac{1}{\sqrt3}\right) +0.25\sqrt3=\frac{\sqrt3}{2}. $$

After normalization, the total error weight is \(0.75(1/\sqrt3)/(\sqrt3/2)=0.50\), and the total correct weight is \(0.25\sqrt3/(\sqrt3/2)=0.50\). In this case, errors do not receive a larger relative multiplier. The negative coefficient reverses the rule’s contribution, which is exactly what the minimization calls for.

Worked Example: A Tied Rule and the Endpoint Case

Suppose a rule has weighted error \(\epsilon=0.50\). Then \(Z(\alpha)=0.5e^{-\alpha}+0.5e^\alpha\), whose derivative is \(0.5(e^\alpha-e^{-\alpha})\). This derivative vanishes at \(\alpha=0\); since \(Z''(\alpha)=0.5(e^{-\alpha}+e^\alpha)>0\), that is the unique minimizer. The minimum is \(Z(0)=1\), and the update multiplies every weight by \(1\), so the weights are unchanged.

By contrast, if a rule classifies every positive-weight example correctly, then \(\epsilon=0\) and \(Z(\alpha)=e^{-\alpha}\). At \(\alpha=0\), the loss is \(1\); at \(\alpha=2\), it is \(e^{-2}\), and it keeps decreasing toward zero as \(\alpha\to+\infty\). There is no finite minimizing coefficient. If every positive-weight example is misclassified, \(\epsilon=1\), \(Z(\alpha)=e^\alpha\), and the infimum is approached only as \(\alpha\to-\infty\).

Common Pitfall and Practical Meaning

A common mistake is to say that AdaBoost’s coefficient always increases the relative weight of misclassified examples. That conclusion silently assumes \(0<\epsilon<1/2\). With \(\epsilon=0.75\), for instance, the optimal error multiplier is \(1/\sqrt3\), smaller than the correct multiplier \(\sqrt3\); the coefficient is negative, not positive. The accurate statement is that a rule with weighted error below one half receives a positive coefficient and increases errors’ weights relative to correct examples. A rule above one half receives a negative coefficient and does the reverse. A tied rule receives coefficient zero.

The endpoint cases also require care. The logarithmic formula gives a finite minimizer only for \(0<\epsilon<1\). At either endpoint, the loss has no finite minimizer; it has an infimum approached as the coefficient diverges in the appropriate direction. Substituting \(\epsilon=0\) or \(1\) into the formula and treating the result as an ordinary finite update is therefore invalid.

Key takeaway: For \(0<\epsilon<1\), minimizing the weighted exponential loss gives the unique finite coefficient \(\alpha^*=\frac12\log((1-\epsilon)/\epsilon)\), and the normalized update assigns half of its total weight to each of the rule’s two prediction groups. The sign of \(\alpha^*\) determines which group’s individual weights are relatively increased.

Check Your Understanding

Use the weighted loss and update derived above to answer the following.

  1. If a rule has weighted error \(0.10\), what is the sign of its minimizing coefficient, and which examples receive the larger unnormalized multiplier?
  2. For weighted error \(0.40\), calculate the minimizing coefficient and minimum loss.
  3. Explain why an error rate of \(0.75\) does not contradict the result that the normalized incorrect and correct groups each have total weight one half.
  4. What happens to the weights when the weighted error is exactly \(0.50\)?
  5. Why is there no finite minimizing coefficient when the weighted error is zero?
Clinical Biostats