AdaBoost
Train a small learner, notice which examples it misses, and give those examples more attention in the next round. Combine the learners with weighted votes.
Start with an example
A depth-one tree asks one question. After it misses some parcels, the next tree trains with more relative weight on those mistakes.
How it learns
An input feature is a measurement about an example. The target is its known answer: a number for regression, or a category for classification. Training means learning from examples whose answers are already known.
- Fit a small classifier, then identify which training examples it misclassifies. Give those examples more weight when fitting the next classifier, so its training pays more attention to them.
- Repeat and combine the classifiers' votes, giving a classifier more influence when its weighted error is lower. Learning rate scales that influence. Each stage depends on earlier mistakes, so the stages must be trained in order.
Try it yourself
The example above gives the idea. The experiment below uses a separate, made-up dataset with unitless measurements so you can focus on how the model works. Read the graph guide first, then change one thing at a time.
1. Understand what you are looking at
Combine simple yes-or-no rules into a class vote. Positive scores favor class 1, negative scores favor class 0; the height is a vote score, not a probability.
- Across: the horizontal axis
- The input measurement x, from 0 to 10. Moving right means a larger input.
- Up: the vertical axis
- The weighted vote score, from -1 to 1. Negative values favor class 0; positive values favor class 1. This is not a probability.
Dark dots show observed classes: class 0 is drawn at -1 and class 1 at +1 so their labels match the score's direction. The green line shows the combined vote score.
How to read one result: Start at x on the bottom axis and follow the vertical dashed line to the outlined diamond on the curve. Read its height on the left: the sign determines the predicted class.
2. Predict, change, observe
- Set Number of stages to 1 and Learning rate to 1. Find dots whose class disagrees with the sign of the prediction line.
- Predict what later rules will focus on. Increase Number of stages to 30: later rules give more attention to previously misclassified examples. Compare the training-error count.
- Observations
- Model prediction
- Inspected result (diamond)
Training errors: 2 of 16.
Training errors count dots whose class disagrees with the vote score's sign. This experiment assigns a zero score to class 1.
3. Explain it in your own words
Does a weighted vote score of 0.8 mean an 80% probability of class 1?
Compare your reasoning
No. The sign chooses a class in this experiment; the score describes the balance of weighted votes. A zero score is assigned to class 1 here. If unsure, compare the vertical score axis with the logistic-regression probability axis before interpreting the number.
Ready to continue when you can explain the result and why it changes. If the explanation is still unclear, reset and repeat the two steps above with one control at a time.
What this experiment simplifies
Each new decision stump gives more weight to examples earlier stumps misclassified. The graph shows a weighted vote score, not a probability.
These are small teaching implementations, not scikit-learn runs. Training error on these examples does not estimate performance on new data.
View the plotted examples
| Input feature (x) | Observed class |
|---|---|
| 0.30 | 0 |
| 0.92 | 0 |
| 1.54 | 0 |
| 2.16 | 1 |
| 2.78 | 0 |
| 3.40 | 0 |
| 4.02 | 0 |
| 4.64 | 1 |
| 5.26 | 1 |
| 5.88 | 1 |
| 6.50 | 1 |
| 7.12 | 0 |
| 7.74 | 1 |
| 8.36 | 1 |
| 8.98 | 1 |
| 9.60 | 1 |
The math, one step at a time
Read the symbols after the idea makes sense. You do not need to memorize the formula.
eₜ is the member's weighted error, η is learning_rate, aₜ is its vote weight, and wᵢ is example i's weight. This binary formula assumes 0 < eₜ < 1/2; fitting handles stopping cases separately.
What to watch for
- Emphasizing difficult examples can also emphasize wrong labels and outliers.
- The binary SAMME weight formula is not a universal formula for every boosting algorithm or multiclass case.
Explore a related model
Further reading
The official documentation goes further when you are ready.