Ensemble Learning Foundations
Source: Unit 3 §1
An ensemble method combines predictions from multiple ML models to make more accurate predictions than any individual model.
The individual learners are usually weak learners - their accuracy is only slightly better than chance, a bit over 50% and not significantly higher. Ensembles are among the most powerful techniques in machine learning, often outperforming everything else, at the cost of increased algorithmic and model complexity.
The two key ideas
Multiple learners can be made different from one another via:
- Different algorithms.
- Different hyperparameters of the same algorithm.
- Different subsets of the training data.
- Different features of the training data.
Construct multiple diverse models from adapted versions of the data - usually reweighted or resampled - then combine their predictions by simple or weighted averaging or voting.
Why ensembles work: variance reduction
Given independent observations , each with variance , the variance of their mean is:
Averaging reduces variance. That single fact is the whole justification.
- Decision trees tend to overfit, which means high variance. Pruning helps but is hard to get right.
- Ensembles combine several weak learners into a final model with low variance.
- Even if the individual learners have high bias, the combined learner can have low bias - and its hypothesis may not even lie in the hypothesis space of any individual learner.
Intuition: independent errors are essential
Picture the instance space as a box, and each learner's errors as a region inside it.
The errors made by the learners must be INDEPENDENT. If the error regions overlap on a point, every learner is wrong there at once and the vote is wrong with them. Independence is achieved by using different subsets of the data or different learners.
Bias-variance recap
| High Bias | High Variance | |
|---|---|---|
| Model | Too simple, few predictors | Too complex, many predictors |
| Behaviour | Can't capture the pattern; oversimplifies | Fits training data too well; poor generalization |
| Error | High error on train AND test | Low train error, high test error |
| Examples | - | Decision Trees / ANNs (low bias, high variance) |
- More flexible, more powerful representations (low bias) lead to high variance: different data subsets produce different models.
- The goal is low bias and low variance - which is exactly what ensembles achieve.
- Basic models perform poorly because of either high bias (low degrees of freedom) or too much variance (high degrees of freedom).
Confidence from many weak learners
- Ensembles prevent overfitting, so there is no need to worry about a stopping criterion.
- If learners each have accuracy 0.7 and all predict the same class, confidence in that class is very high.
- In reality learners predict class 1 and predict class 2. Say , so voting gives class 1. The probability that the true class really is class 1 can be computed from the learners' accuracies, binomial-style.
Combining, and the three types of ensemble
| Strategy | Examples |
|---|---|
| Manipulate the data distribution | Bagging, Boosting |
| Manipulate the input features | Random Forests |
| Manipulate the class labels | Error-Correcting Output Coding |
Ask what is being manipulated. Resampled or reweighted rows means bagging or boosting; sampled columns means random forests; recoded labels means error-correcting output coding.