Skip to content
AI360XpertBeta
Core ML

Visual explainer

AdaBoost

Trace classic binary AdaBoost through five illustrative samples, normalized reweighting and three signed stump votes, with training and noise limits.

A single threshold misses sample 4 in the five-sample training set.
A single threshold misses sample 4 in the five-sample training set.

AdaBoost repeatedly fits a classifier using sample weights, then combines the classifiers with weighted signed votes. Our synthetic feature values are 1 through 5, with labels +, +, −, +, −. Above the step are observed labels; dots on the step show predictions. The first stump predicts plus up to 2.5 and minus after it, missing sample 4, which is ringed. A single cut cannot reproduce both class reversals.

Start With Equal Weights

Five equal sample weights give the first stump weighted error 0.20.
Five equal sample weights give the first stump weighted error 0.20.

Each bar measures sample weight, initially 0.20; their sum is one. The cross identifies the only mistake. Weighted error is the sum of weights on mistakes, so ϵ1=0.20\epsilon_1=0.20. We use classic binary AdaBoost with labels and stump outputs ±1, no shrinkage, and αt=12ln⁡((1−ϵt)/ϵt)\alpha_t=\tfrac12\ln((1-\epsilon_t)/\epsilon_t). The first stump therefore receives vote weight α1=12ln⁡4=0.693147\alpha_1=\tfrac12\ln4=0.693147.

Sample weight controls fitting; stump vote weight controls prediction. These are different quantities. The algorithm in Schapire's explanation specifies both.

Normalize the Update

Normalized reweighting assigns half the sample weight to the missed sample 4.
Normalized reweighting assigns half the sample weight to the missed sample 4.

Multiply each weight by exp⁡(−α1yih1(xi))\exp(-\alpha_1 y_i h_1(x_i)). A hit multiplies by 0.5 and a miss by 2. Raw weights become 0.10, 0.10, 0.10, 0.40, 0.10. Divide by their sum, 0.80, to obtain 0.125, 0.125, 0.125, 0.50, 0.125. These sum to one. The bars keep the previous scale, 300 drawing units per unit weight. The dashed mark through bar 4 is its old 0.20 height.

Refit the Threshold

Refitting on the new weights moves the best threshold from 2.5 to 4.5.
Refitting on the new weights moves the best threshold from 2.5 to 4.5.

Both rows retain the feature scale of 100 drawing units per feature unit. Under the new weights, the old cut misses sample 4 and costs 0.50. The new cut at 4.5 predicts plus on its left and minus on its right; it misses sample 3 and costs only 0.125. Each makes one raw mistake, but the weighted errors differ. The new stump receives α2=12ln⁡7=0.972955\alpha_2=\tfrac12\ln7=0.972955.

For reproducibility, we compare all midpoint thresholds in both polarities, including constant rules. Ties choose the smaller threshold, then plus on the left. That rule selects cut 2.5 in round one.

Reverse the Polarity

The third stump reverses polarity to protect the heavily weighted sample 3.
The third stump reverses polarity to protect the heavily weighted sample 3.

After the second normalized update, weights are 1/14, 1/14, 1/2, 2/7, 1/14. The bars retain the same weight scale. The third cut at 3.5 predicts minus on the left and plus on the right, preserving heavily weighted sample 3. It misses 1, 2, and 5: three mistakes with total weight 3/143/14, better than sacrificing the half-weight sample. Its vote weight is α3=12ln⁡(11/3)=0.649641\alpha_3=\tfrac12\ln(11/3)=0.649641. Minimizing weighted error can increase the raw mistake count.

Add Signed Votes

Three signed stump votes move sample 4 from a negative score to a positive score.
Three signed stump votes move sample 4 from a negative score to a positive score.

For sample 4, stump outputs are −, +, +. Each horizontal arrow is a signed vote displacement; short dashed connectors carry the accumulated score into the next row. The long dashed guide is zero. At 160 drawing units per score unit, the path is 0→−0.693147→0.279808→0.9294490\to-0.693147\to0.279808\to0.929449. Taking the sign of the final score predicts plus, correcting the original mistake. The final arrow ends at a positive score; the model does not average numeric class IDs.

Check the Training Set

The signs of the three-round scores match all five training labels.
The signs of the three-round scores match all five training labels.

All five scores use one vertical scale of 100 drawing units per score unit, rising above zero for plus and falling below for minus. The totals are 1.016461, 1.016461, −0.369834, 0.929449, −1.016461. Their signs match the labels printed above. This is a training result only. Held-out evaluation is needed to choose rounds and base-model complexity; fitting this fixture in three rounds supplies no universal stopping rule. More rounds add fitting and inference work.

Predict Without Refitting

A fresh query at 3.8 receives stump votes minus, plus, and plus.
A fresh query at 3.8 receives stump votes minus, plus, and plus.

All three rows place the query at the same position. Here the feature origin shifts by 80 drawing units to leave room for row labels; the feature scale remains 100 per unit. The cuts are still 2.5, 4.5, and 3.5. Query 3.8 falls right, left, and right respectively, giving votes −, +, +. Its score is 0.929449 and prediction plus. No true label is supplied, so this demonstrates inference, not test accuracy. Training weights are not recomputed for the query.

A Stump Can Add Nothing

A stump with equal correct and mistaken sample weight receives zero vote weight.
A stump with equal correct and mistaken sample weight receives zero vote weight.

This separate boundary case has equal correct and mistaken weight: the two blocks each occupy half the total mass. Then ϵ=0.5\epsilon=0.5 gives α=12ln⁡1=0\alpha=\tfrac12\ln1=0, represented by a point with no displacement on the lower score axis. The stump adds no vote. Useful positive vote weights require error below one half. A perfect stump has error zero, so the logarithmic formula needs a stopping or special-case policy; it is not a finite ordinary update.

Where It Breaks

Opposite labels at the same feature value cannot both be classified correctly.
Opposite labels at the same feature value cannot both be classified correctly.

Replace the clean fixture with two equally weighted observations at the same feature value 4 but opposite labels. Any deterministic stump, and the resulting ensemble, must give the same prediction for both. Predicting plus misses the minus label; predicting minus misses the plus label. The best weighted error is one half. Reweighting disagreement cannot recover missing information or identify which label is wrong. In less symmetric noisy data, difficult or incorrect labels can attract extra weight without revealing their cause.

The Quick Version

  • A stump can miss a class reversal.
  • Uniform weights make raw and weighted error proportional.
  • Normalize every sample-weight update.
  • New weights change the best threshold.
  • Weighted error can improve despite more raw mistakes.
  • Combine signed stump votes.
  • Training fit does not establish test accuracy.
  • Fresh queries use the learned stumps unchanged.
  • Error one half gives zero vote weight.
  • Conflicting identical inputs impose irreducible error.