Skill 2.2.6
Combine multiple ML models to improve performance or reduce cost
Key Concepts
Bagging trains models on bootstrap samples and averages them (random forest), lowering variance. Boosting trains models in sequence on previous errors (XGBoost, LightGBM), lowering bias. Stacking trains a meta-model on the outputs of different models.
To reduce cost, a cascade sends every request to a small model first and only escalates uncertain cases to a larger one; prompt routing does the same for FMs. Serial inference pipelines can chain models on one endpoint.