Documenting models
Model cards: what a model is for, how it was evaluated and where it should not be used.
Lesson 66 of 6610 minBeginner
You will learn to
- List the sections of a model card
- Write intended use and limitations in plain language
- Keep documentation next to the model version it describes
Before this lesson
Intuition
Medicine comes with a leaflet: what it is for, who should not take it, side effects, how it was tested. You would not take pills from an unlabelled jar. A model that makes decisions about people or money deserves the same leaflet.
A model card is a short document that describes a trained model so that someone who did not build it can decide whether to use it, and how. The goal is not paperwork. It is to prevent two common failures: a model used for a purpose it was never built for, and a model whose weaknesses nobody knew.
A good card answers the questions of different readers. A business owner asks "what is it for, and can I trust it?". An engineer asks "what does it need as input, and how do I run it?". An auditor asks "how was it evaluated, and who approved it?". A user affected by a decision asks "is it fair to me?".
A card stays short because it is written for people who will not read a long report. One or two pages, in plain language, with numbers where they help.
Picture it
The math
A model card needs no formulas, but its metrics section needs honesty about uncertainty. A score from a test set is an estimate. For an accuracy measured on test rows, a rough 95% margin of error is
where is the observed share of correct predictions and 1.96 is the standard normal value that leaves 2.5% in each tail. The approximation is rough for very small samples or for values near 0 or 1, but it gives the right order of magnitude. Reporting "accuracy 0.84 (about plus or minus 0.03 on 500 rows)" is more honest than "accuracy 0.84".
Worked example
Here is a short model card for an illustrative model. All numbers are invented for the example, except the margin, which follows from the formula.
Model: churn-classifier, version 3. Owner: customer analytics team. Date: 22 November 2026.
Intended use. Rank current subscribers by their risk of cancelling in the next 30 days, so the retention team can contact the top 5% each week. Intended users: the retention team.
Out of scope. Do not use it to decide prices or to deny service. Do not use it for business customers: they were not in the training data.
Training data. 48,000 consumer subscribers, January 2025 to June 2026, dataset version 4. Target: cancelled within 30 days (11% of rows).
Evaluation. Held-out set of 9,600 rows from the same period. Accuracy 0.89. Because only 11% cancel, accuracy is misleading, so we also report recall for cancellers: 0.62, and precision: 0.48 at the contact threshold.
| Group (region) | Rows | Recall for cancellers |
|---|---|---|
| North | 4,100 | 0.64 |
| South | 3,900 | 0.63 |
| Islands | 1,600 | 0.51 |
The margin on accuracy is 1.96 x sqrt(0.89 x 0.11 / 9,600) = 1.96 x 0.00319 = about 0.006, so plus or minus 0.6 percentage points. The Islands group is smaller and has lower recall, which is stated in the limitations.
Limitations. Weaker for the Islands region. Inputs older than 90 days are not allowed. Behaviour after a price change is untested. Drift is checked weekly; retraining is guarded by a margin.
Version and approvals. Registered version 3, approved by two people. Previous version 2 is kept for rollback.
Notice what the card does: a reader who is about to use it for business customers or for pricing finds the warning in one place.
How mlflow does it
- Model card tab. On a model candidate, the Model card tab shows the diagnostics of the model, such as plots and a metric summary. It needs the run to be promoted to a saved pipeline first.
- Export model card. Downloads a Markdown file with the model's metrics, hyperparameters and pipeline structure: the facts a machine can fill in. You add the human parts, such as intended use, out of scope and limitations.
- Notes. Each candidate has a notes field (Markdown) for what worked and what to revisit.
- Registry. Registered model versions have a status (staging, production, archived) and, for production, an approvals workflow, so the card can be reviewed before promotion.
- Cohort metrics. The Validation tab gives metrics by group to fill in the by-group section.
Keep the card with the version. When you promote a new version, update the card, and keep the old one with the old version.
Common mistakes
- Writing the card after the launch. Then it is a formality. Draft it when you frame the problem and complete it before approval.
- Listing only strengths. A card without limitations is marketing. State where the model is weak, in the words a non-expert understands.
- Reporting one overall number. Add the group results, the group sizes and the margin of error.
- Describing "the model" instead of a version. Versions change. Tie each card to one version and its data version.
- Hiding the card. If users cannot find it where they find the model, they will not read it. Link it from the registry entry and the project.
Try it in mlflow
Open a model card and export it
- Open Runs, click a run and open a model candidate.
- Open the Model card tab and read the diagnostics. If the run has not been promoted, promote it first.
- On the candidate, write your notes (Markdown allowed) about what worked and what to revisit.
- Choose Export model card to download a Markdown file, then add the sections that the export does not contain (intended use, limitations).