ML4: Evaluation you can trust

Lesson 4 of 5 · reading 15–25 minutes; practice and project time is on the module page

Thresholds and the cost of mistakes

🎯You'll be able to

Choose a threshold from the costs of each kind of mistake, or from a minimum recall agreed with the people who use the model, on validation data.

🏠The everyday picture

A shop owner decides how much stock to keep by weighing the cost of running out against the cost of unsold stock. A threshold is the same kind of decision: weigh missed late parcels against unnecessary calls.

📘What it really is

📝A worked example

Input: illustrative costs, chosen for this example and not DakDost's real figures: each call costs ₹20 of staff time; each late parcel costs ₹150 in refunds and complaints; a call prevents half of the late parcels it reaches.

cost = 20 × (TP + FP) + 150 × (FN + 0.5 × TP)

Expected output (reference figures, 2 November 2026):

Threshold May cost June cost
No calls at all ₹28,350 ₹32,250
0.5 ₹24,820 ₹28,475
0.30 (the kit's recall rule) ₹23,960 ₹27,085
0.22 (lowest cost on May) ₹23,660 ₹26,905
0.15 ₹23,865 ₹26,440

On these costs, a threshold around 0.15 to 0.3 does best, and every threshold beats no calls. The cheapest point on May (0.22) wasn't the cheapest on June (0.15 did better there), a reminder that the choice is an estimate.

🌍Where it's used

📝Case scenario

A lender used the default 0.5 threshold for a "needs manual review" model and its reviewers sat idle while bad loans slipped through. Working out the cost of a missed bad loan against a review hour moved the threshold to 0.2, filling the review team's capacity and cutting losses. They recorded the costs and agreed to revisit them every quarter.

🖱️Try it

Change the cost of a late parcel from ₹150 to ₹300 and find the lowest-cost threshold on May. Success: it moves lower (more calls), and you can explain why.

⚠️Common mistakes

🛠️For your project

Project 1's test 7 recomputes the threshold on May with the kit's rule (recall at least 0.60, highest precision) and checks that it matches.

✅Quick check

Why not use 0.5 as the threshold?

Show the answer

It's a habit, not a decision; the right threshold depends on the costs of each mistake.

Where should the threshold be chosen?

Show the answer

On validation data, then reported once on the test set.

← PreviousRanking scores: ROC and precision–recall curves
ProLearners Assist