Module 4 · step 5 of 5 · Training and comparing runs
Ensembles and explanations
Blend or stack candidates, check that the ensemble earns its place, and see which columns drive a model.
App8 min
In this step you will combine candidates into an ensemble, compare it with its best member and then open a trial to see which columns drive its predictions. It matters because an ensemble that does not beat its best member is only extra complexity, and a model you cannot explain is hard to trust or to defend.
The idea
An ensemble combines several models on the idea that they make different mistakes. mlflow offers Blend (the models vote or average their predictions) and Stack (a meta-learner is trained on their predictions and learns how much to trust each model). From a single trial you can also build Bagging or Boosting versions of one estimator. Each result is a new row in the same run.
An explanation answers "which columns drive the prediction?". On a trial's Plots tab, Explainability holds Feature importance (how much the model leans on each column) and Permutation importance (how much the score drops when a column is shuffled, closer to a real test).
Step by step
- On the Leaderboard tab, tick the check boxes of two or three good candidates. A bar shows how many models are selected.
- Select Combine... and choose Blend models or Stack models. For a blend pick the Method: Soft voting, Hard voting or Averaging. For a stack pick the Meta-learner. Select Start blend or Start stack.
- When the event log says Blend ready or Stack ready, open the new
blendedorstackedcandidate and read Blend contribution or Stack contribution: Beat best base by or Trails best base by a number. Keep the ensemble only if it beats. - To bag or boost one model instead, open it, choose Improve, then Ensemble, pick Bagging or Boosting and set Number of estimators.
- Open the best candidate and its Plots tab. Under Explainability, read Feature importance and Permutation importance. Check that the top columns make sense for churn.
- Open Validation to see per-fold Cross-validation scores and Cohort metrics, which show how the model does on slices of one column.
Common mistakes
- Choosing Soft voting for a model without probabilities. The dialog says "Soft voting needs class probabilities" and names the model; use Hard voting.
- Mixing models trained with different preprocessing. The app asks you to pick models from the same variant.
- Keeping a blend that Trails best base by a number. Use the single model.
- Reading importance as cause and effect. It shows what the model uses, not what changes churn.
- A top column that would not be known at prediction time. That is usually leakage; fix it in Columns.
As a data scientist
Ensembles are worth it when the members differ and the gain survives cross-validation. Importance is a sanity check as much as an explanation: a surprising top column is more often a data problem than a discovery. Do both before you register a model.
Checkpoint
You should see a new blended or stacked candidate with a Blend contribution (or Stack contribution) that says Beat best base by or Trails best base by, and Feature importance and Permutation importance charts under Explainability on the Plots tab.