Ensemble Methods & Stacking
Why Ensembles?
Wisdom of diverse models
Different models make different errors — combining 3 models via majority vote cancels out individual mistakes, boosting accuracy from 80% to 100%.
Step 1 of 6: Why Ensembles?
Wisdom of diverse models
Different models make different errors — combining 3 models via majority vote cancels out individual mistakes, boosting accuracy from 80% to 100%.
Step 2 of 6: Hard Voting
Majority rules
Hard voting picks the class with the most votes. With 3 models, a prediction needs 2+ votes to win — simple but ignores confidence.
Step 3 of 6: Soft Voting
Weighted probabilities
Blended weights (50% accuracy-based). Each model's weight is a mix of equal (1.0) and its accuracy. This balances fairness with rewarding better models.
Step 4 of 6: Stacking: Level 0
Base model predictions
Fold 1 is held out for validation. The 5 base models train on folds 2–5, then predict on fold 1. These out-of-fold predictions become input features for the meta-learner.
Step 5 of 6: Stacking: Level 1
The meta-learner
The meta-learner balances model contributions — SVM and LR get the most weight. Regularization prevents any single model from dominating.
Step 6 of 6: Comparing Strategies
Voting vs. stacking
At low noise, all strategies perform similarly — simple voting may suffice.