Working with stakeholders
Agree on the decision a model supports, translate metrics into costs and report results honestly.
Lesson 4 of 6610 minBeginner
You will learn to
- Translate a metric into business impact
- Set expectations about uncertainty
- Present results with a baseline and caveats
Before this lesson
Intuition
A model that nobody trusts or understands does not get used, however good its score. The people who decide whether to use it are usually not data scientists. They care about money, risk, customers and deadlines. Your job is to translate in both directions: from their goals to a prediction problem at the start, and from a score back to their goals at the end.
Three habits make this much easier:
- Speak in consequences, not metrics. "AUC is 0.86" means little to most people. "Out of 100 customers about to leave, we find 60 of them and contact 40 who would have stayed anyway" can be acted on.
- Always give a comparison. A number is only good or bad against something: the current process, a simple rule or a trivial baseline.
- Be honest about uncertainty. A model is estimated from a sample and will make mistakes. Saying so early builds more trust than a surprise later.
Picture it
Different errors cost different amounts. A cost matrix makes that explicit: rows show what really happened, columns what the model said, and each cell holds what that outcome costs.
Agree the numbers in this table with the business owner before you tune the model. It takes five minutes and changes which model is best.
The math
With a cost matrix, the total cost of a model is simply the count of each error times its cost:
Here is the number of false alarms, the number of misses, and and what each costs. Correct predictions are assumed to cost nothing extra.
When a model returns a probability (and the probabilities are well calibrated), the cost-minimising rule is to raise the alarm whenever:
So the cost matrix sets the threshold. It is not always 0.5.
To express uncertainty about a rate measured on cases, a rough 95% interval is:
where is the measured rate. It is only an approximation, but it is enough to stop people reading a difference of two points on 100 cases as meaningful.
Worked example
A lender receives 1,000 applications. In the past data, 100 of them end in default. Illustrative costs: a missed default (approving a loan that is lost) costs 5,000; a false alarm (refusing a good customer) costs 500 of lost margin.
Three options, each with its total cost:
| Option | Missed defaults | False alarms | Cost |
|---|---|---|---|
| Approve everyone | 100 | 0 | |
| Refuse everyone | 0 | 900 | |
| The model | 30 | 90 |
The model finds 70 of the 100 defaults (a recall of 70%), and of the 160 applications it flags, 70 are real defaults (a precision of ). Compared with approving everyone, it saves .
The threshold for a calibrated probability is , about 9%. Refuse when the chance of default is above 9%, not above 50%: a missed default is so much worse than a false alarm that it is worth refusing many borderline cases.
Uncertainty. The recall of 70% was measured on 100 defaults. Standard error: , so the 95% interval is about , from 61% to 79%. A one-page summary can read: "The model would have caught about 70 out of 100 defaults (plausibly 61 to 79), where approving everyone catches none. Estimated saving against approving everyone: about 305,000 per 1,000 applications, based on the cost figures agreed with Risk. Main caveat: it was tested on past applications, and applicant behaviour can change."
All numbers in this example are illustrative.
How mlflow does it
Several screens help you prepare what to say.
- Runs, Leaderboard: the ranked models of a run, including a Baseline reference model in compare runs for classification and regression. The leaderboard caption states which metric it is ranked by.
- Model card: open a run, then use the overflow menu and choose Model card to see the metric summary and diagnostic plots for the model. Plots are good material for a presentation because they show where errors happen.
- Export model card: on a trained model's page, the overflow menu can download a Markdown model card with metrics, parameters and the pipeline structure, which is a good attachment for a written report.
- AI explanation: on a run, the AI explanation card (button Explain) reads the leaderboard and suggests next steps. It is advisory, so check its reasoning before repeating it to others. It needs an AI provider key configured in settings.
The Model card is available once the run has succeeded. It needs a saved pipeline: if the run has not been promoted yet, the page offers Promote run first.
Common mistakes
- Reporting accuracy alone. With rare events, accuracy is high for a model that never raises an alarm. Report what the decision needs: how many cases found, how many false alarms, what that costs.
- Giving a number without a baseline. "85%" is neither good nor bad. State what the current process or a trivial rule would score.
- Promising the test score for production. Test scores are estimates and the future can differ. Give a range and say what you will monitor.
- Hiding the caveats. Which data it was trained on, which groups it works worse for, what has not been tested. Put them on the same page as the result, not in an appendix.
- Agreeing on cost after seeing results. If the costs are chosen once the scores are known, they will drift to flatter the model. Agree them first.
- Burying the decision under technical detail. Lead with what the reader can do with the result. Put algorithms and settings at the end for those who want them.
Try it in mlflow
Open a run and its model card
- Open Runs and pick a finished run.
- Open the overflow menu of the run and choose Model card.
- Write three sentences about the result for someone who has never seen the screen: what it predicts, how well, and what to be careful about.