Artificial Intelligence Fundamentals / Use AI Responsibly

Document a model

Lesson 24 of 26. Open to read. No account needed.

Why a Model Needs a Summary

A trained model is a file of numbers. Nothing in it says what it was built for, what data it learned from, how it was tested or where it should not be used. Six months later, a colleague who finds it, or a manager who wants to use it for something new, cannot tell. A short written summary answers those questions and, just as importantly, records the limits of the evidence.

The idea is widely used under the name model card: the Hugging Face Hub, for example, describes model cards as files that accompany a model and state its intended uses and limitations, including biases. This lesson uses a compact version with five sections.

The Five Sections

SectionWhat it says
Intended useWhat the model predicts, from which inputs, for what purpose
Not suitable forUses the evidence does not support
DataWhere the data came from, how much, and how it was split
EvaluationThe chosen metrics on held-out data, beside the baseline, and per group where relevant
LimitationsWhat the evaluation cannot show: small test sets, unrepresented situations, untested groups

Claims Within the Evidence

The hardest part of a summary is not writing; it is not claiming more than the evidence supports. Three habits help:

  • Name the test. Not "the model is 96% accurate" but "the model scored 0.964 on 450 held-out images from the bundled digits data".
  • Separate what was tested from what was not. Untested groups, situations and time periods belong under limitations, not silence.
  • Avoid words the evidence cannot carry: "always", "any", "validated", "unbiased", "ready for", unless you have evidence for exactly that claim.

Exercise: Write a Model Summary

You will run a script that prints the facts a summary needs for the wine classifier from the classifier lesson, then fill in a summary template.

Starting state: the course environment, active in your terminal. The wine data ships with scikit-learn.

  1. Create the exercise folder. macOS and Linux:

    mkdir -p ~/ai-practice/model-summary
    cd ~/ai-practice/model-summary
    

    Windows PowerShell:

    mkdir $HOME\ai-practice\model-summary
    cd $HOME\ai-practice\model-summary
    

    Save this as summarise_model.py in that folder:

    """Print the facts a model summary needs for the wine classifier."""
    from sklearn.datasets import load_wine
    from sklearn.dummy import DummyClassifier
    from sklearn.linear_model import LogisticRegression
    from sklearn.metrics import recall_score
    from sklearn.model_selection import train_test_split
    from sklearn.pipeline import make_pipeline
    from sklearn.preprocessing import StandardScaler
    
    X, y = load_wine(return_X_y=True)
    X_train, X_test, y_train, y_test = train_test_split(X, y, random_state=0, stratify=y)
    model = make_pipeline(StandardScaler(), LogisticRegression()).fit(X_train, y_train)
    baseline = DummyClassifier().fit(X_train, y_train)
    
    print("Training wines:", len(y_train), "| test wines:", len(y_test))
    print(f"Test accuracy: {model.score(X_test, y_test):.3f} (baseline {baseline.score(X_test, y_test):.3f})")
    recalls = recall_score(y_test, model.predict(X_test), average=None)
    for grower, value in enumerate(recalls):
        print(f"Recall for grower {grower}: {value:.2f}")
    

    Then save this as model_summary.md in the same folder:

    # Model summary: wine grower classifier
    
    ## Intended use
    <One sentence: what the model predicts, from which inputs, and for what purpose.>
    
    ## Not suitable for
    <One sentence: a use that the evidence does not support.>
    
    ## Data
    <Where the data came from, how many samples, and how it was split.>
    
    ## Evaluation
    <Test accuracy beside the baseline, and recall for each grower.>
    
    ## Limitations
    <At least two limits, such as the size of the test set and how well the data represents other wines.>
    
  2. Run the script:

    python summarise_model.py
    

    Output, which should match exactly:

    Training wines: 133 | test wines: 45
    Test accuracy: 1.000 (baseline 0.400)
    Recall for grower 0: 1.00
    Recall for grower 1: 1.00
    Recall for grower 2: 1.00
    

How the Script Works

It trains the scaled logistic regression from the classifier lesson on the same split, and a baseline beside it. recall_score(..., average=None) treats each grower in turn as the positive class and returns one recall per grower: of the wines that really came from grower 0, the share labelled grower 0, and so on. For a model with several classes, per-class recall shows whether any class is served worse, as per-group recall did in the fairness lesson.

  1. Open model_summary.md in your editor and replace each line in angle brackets with your own text, using the printed facts and what you learned about the wine data in the inspection lesson. Keep the headings. Save the file.

  2. Check your summary against this list:

    • Every section is filled in, and no angle brackets remain.
    • The numbers match the script's output exactly: 133 and 45 wines, 1.000 against 0.400, and the three recalls.
    • The test is named: held-out wines from one dataset.
    • The limitations mention the small test set, and that all wines come from one region and three growers.
    • No sentence claims more than the evaluation showed.

Success: your summary passes every point of the checklist.

If something differs:

What you seeLikely causeNext step
Different numbers from the listingThe split or model was changedRestore the script exactly
Your editor saved model_summary.md.txtSome editors add an extensionSave as plain text named exactly model_summary.md; check with ls
ValueError about averageThe average=None argument was changedRestore it exactly
You are unsure whether a sentence overclaimsNormal; it is the hard partAsk: which printed number or fact supports this sentence?
  1. Clean up. macOS and Linux:

    cd ~/ai-practice
    ls
    rm -rf model-summary
    ls
    

    Windows PowerShell:

    cd $HOME\ai-practice
    ls
    Remove-Item -Recurse model-summary
    ls
    

    Check that the first ls shows model-summary before removing it, and copy your summary elsewhere first if you want to keep it. Do the independent task first.

Independent task: this summary was written for the same model. Find the three overclaims and rewrite each one so that it stays within the evidence.

This model identifies the grower of any wine with 100% accuracy. It has been fully validated and is ready for use in wine trading. It is free from bias because it does not use any information about people.

Check Your Understanding

  1. What is the difference between "accurate on the wine test data" and "accurate"?
  2. Why does a model summary need a "Not suitable for" section when the intended use is already stated?

Answer and Reasoning

Independent task

One possible rewrite, with the reason for each change:

  • "Identifies the grower of any wine with 100% accuracy" becomes "Scored 1.000 accuracy on 45 held-out wines from one dataset of three growers in one region of Italy." The evidence covers 45 wines from one dataset, not any wine.
  • "Fully validated and ready for use in wine trading" becomes "Evaluated once on a small test set; not evaluated for any commercial use." One test on 45 wines validates nothing about trading decisions.
  • "Free from bias because it does not use any information about people" becomes "Fairness was not assessed. Recall was equal across the three growers in this test, but wines from other growers or regions were not tested." Not using personal data does not make a model unbiased.

A complete example of the filled-in summary:

# Model summary: wine grower classifier

## Intended use
Predicts which of three growers produced a wine from its 13 chemical measurements, for teaching how a classifier is evaluated.

## Not suitable for
Identifying the grower of wines from other regions, other growers or other years, or any decision with financial or legal consequences.

## Data
The scikit-learn copy of the UCI wine recognition data: 178 wines from three growers in one region of Italy, split into 133 training and 45 test wines, stratified by grower.

## Evaluation
Test accuracy 1.000 against a most-frequent-grower baseline of 0.400; recall 1.00 for each of the three growers.

## Limitations
The test set has only 45 wines, so a perfect score on it does not mean the model never makes mistakes. All wines come from one small, old dataset from one region, so the results say nothing about other wines.

Understanding check

  1. "Accurate on the wine test data" names the evidence: one test on 45 wines from one dataset. "Accurate" claims something general that the evidence cannot support: performance on wines, growers and conditions that were never tested.
  2. Readers often want to reuse a model for something nearby, and an intended use does not warn them off. Naming unsupported uses explicitly, such as other regions or commercial decisions, prevents the most likely misuse.

References

Study this course with an account

Course access adds revision notes, the Quick Reference, saved progress, bookmarks and your own notes.

INR 199 plus 18% GST. 90 days of online access. No auto-renewal.

See course access

This website is operated by VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED, operating as Vectametric.

Corporate Identity Number (CIN): U85499KA2026OPC229822. GSTIN: 29AAMCV8281D1ZS. Registered office: RS NO/38/2A/1 BASTAND, ROAD MAHANTESH NAGAR, Ramdurg, Ramdurg, Belgaum- 591123, Karnataka.

Queries and grievances: Prajval Honnungar, Grievance Officer and Data Protection Contact.

Telephone: +91 94800 09310. Support: support@vectametric.com. Grievances: support@vectametric.com.

Copyright 2026 VECTAMETRIC EDTECH (OPC) PRIVATE LIMITED. All rights reserved.

Vectametric home · Roadmaps · Vecta IT Exams · Vecta Government Exams · Vecta Banking & Finance Exams · Vecta Entrance Exams · About us · Contact · Privacy Policy · Terms and Conditions · No-Refund Policy