Machine Learning, FoundationsLesson 43 of 92

Module 5 · Measuring a model honestly

The four numbers, worked through

In this lesson

  • 9 min read
  • 7 reading sections
  • Knowledge check
  • Lesson 2 of 11 in this chapter

This chapter’s goalGiven a fitted classifier and a stated cost of each kind of error, compute the confusion matrix at a chosen threshold, defend that threshold by expected cost, say whether the model’s probabilities are calibrated, decide with an interval whether one model genuinely beats another, and report per-group performance with a defensible fairness criterion and its known trade-offs.

This chapter’s media

The film explains chapter ideas. The audiobook narrates the complete teaching text.

FormatEnglishहिंदी
Chapter filmWatch1:59Not available
Full audiobookNot availableNot available
1,000 transactions, 40 fraudulent, threshold 0.5FlaggedNot flaggedActually fraud24true positives16false negativesActually fine6false positives954true negativesPrecision 24 / 30 = 80 per cent divides by what the model said: the Flagged column. Recall 24 / 40 =60 per cent divides by what was true: the top row. Accuracy is 97.8 per cent, against 96 per cent fora model that flags nothing at all.
Precision 24 / 30 = 80 per cent divides by what the model said: the Flagged column. Recall 24 / 40 = 60 per cent divides by what was true: the top row. Accuracy is 97.8 per cent, against 96 per cent for a model that flags nothing at all.

Figure

A little at a time

Explore an idea, try it, then check what stays.

Step 1 of 9Free · no account needed
Lesson steps

One thousand transactions

A fraud model runs on 1,000 transactions. 40 are fraudulent. At a threshold of 0.5 the model flags 30 transactions, and 24 of them are fraud.

Four numbers describe everything:

Text
True positives  (TP) = 24    flagged and fraudulent
False positives (FP) =  6    flagged, actually fine
False negatives (FN) = 16    not flagged, actually fraud
True negatives  (TN) = 954   not flagged, fine

Check the arithmetic: 24 + 6 + 16 + 954 = 1,000, and 24 + 16 = 40 actual fraud cases. Everything below is derived from these four.

Your place and first choices stay on this browser. Classroom credit is recorded separately.

Every lesson here is open. Your progress is recorded once you pass the How a Language Model Actually Works exam.

Stuck on something?Ask Funke, your AI tutor

How to cite: Addaly (2026) ‘The four numbers, worked through’, in Machine Learning, Foundations. Edited by M. Mun. Addaly. Available at: https://addaly.com/learn/machine-learning-foundations/confusion-matrix-worked (Accessed: 29 November 2026).