Artificial Intelligence · AI Foundations
Cost-Sensitive Decisions
In AI because a classifier's output is a decision with a price, and choosing the threshold is choosing who pays it.
A classifier does not output decisions; it outputs scores, and someone must choose the score above which the system acts. That choice — the threshold — is where error costs, and the people who bear them, enter the mathematics. This lesson turns 'the model is 99% accurate' into the questions that actually decide deployments: which mistake costs what, to whom, and where the cut should therefore sit.
- Artificial Intelligence
- Medium level
- 5 concepts
1Two errors, two prices
A binary classifier can be wrong in exactly two ways. A false positive acts when it should not have: the reliable applicant scored as risky, the healthy patient flagged for review. A false negative fails to act when it should have: the default not predicted, the disease not caught. The words name the model's claim, not the truth — 'positive' is what the model said.
No metric decides which error matters more; the world does. In credit, the false positive quietly costs one family a home while the false negative costs the lender one default. In triage, the asymmetry reverses: the false positive is one unnecessary test, the false negative can be fatal.
Symmetric metrics — accuracy, F1 — carry a hidden assumption: both mistakes cost the same. Whenever that is false, a model chosen by a symmetric metric is optimised for a world other than the one it will act in.
So the first artefact of a cost-sensitive design is not a model but a sentence: 'in this system, the dear error is X, because Y bears Z when it happens.' Everything later — the cost matrix, the threshold — is that sentence turned into numbers.
Figure. The credit grid with its costs named. Both off-diagonal cells are errors, but they are not the same event: the lender absorbs one default in the approved-but-defaults cell, while the refused-but-would-repay cell lands on a person — and shows up in no revenue metric the lender tracks.
| Setting | Dear error | Why |
|---|---|---|
| Credit scoring | False positive — a reliable applicant refused | The applicant bears a life-sized cost; the lender's alternative loss was one default |
| Medical triage | False negative — a sick patient sent home | One extra test is cheap; a missed case can be fatal |
| Spam filtering | False positive — a real mail buried | A spam that gets through costs seconds; a lost offer letter costs the job |
2Impact is part of the design
Wrong predictions are not abstract: they deny loans, bury job applications, deprioritise patients. The error-asymmetry concept named the two directions a mistake can take; this one names the people attached to them, because 'the model is wrong 8% of the time' says nothing about who the 8% are or what being in it costs them.
Impact analysis asks three questions before any fitting starts. Who is being scored — applicants, patients, defendants — and do they know they are? Who bears each error direction — because the false-alarm bearer and the miss bearer are almost never the same party? And what recourse exists — how does a person even learn a model refused them, let alone contest it?
The recourse question is the one engineering forgets. A system nobody can appeal converts every model error into a permanent fact about a person; a system with an appeal path converts its errors into work. Those are different products, and the difference does not appear in any offline metric.
None of this is a plea to feel responsible. These are design inputs: the answers change the metric (which slice matters), the threshold (whose error is dear), and the architecture (where the human review goes). The ethics and governance lesson builds the concrete checks — bias, leakage, monitoring — on this footing.
Figure. The error-asymmetry grid with people, not counts. The false-alarm cell lands on the applicant; the miss lands on another party. Recourse is the only path back out of a wrong cell — without it the error is a permanent fact.
The impact questions
- Who is scoredName the people the predictions act on — not the rows, the people — and check they know they are being scored.
- Who bears each errorAttach the false alarm and the miss to the party each lands on; they are almost never the same.
- What recourse existsDefine how a wrong decision is discovered, contested and corrected — and how long that takes.
A loan model reports 92% accuracy. Why is that number an incomplete account of the system?
- It averages over people and says nothing about who the other 8% are or what a refusal costs them
- It is simply too low a figure for any system that reaches production
- Accuracy is never a legitimate metric for any classifier
- Ethics review only becomes relevant above a 95% accuracy threshold
A single average hides its own distribution. Who absorbs the errors, and what the error does to them, are questions the metric was never asked.
3Expected cost: pricing the errors
Once the two error directions have owners, give them prices and the comparison of models becomes arithmetic. The expected cost of a classifier on a dataset is the sum over its errors of what each error costs. The cost matrix — a price per cell of the confusion grid — turns four counts into one number that, unlike accuracy, points the same way as the harm.
The prices only need to be right relative to each other: what matters below is that a missed fraud costs about a hundred times a wasted review, not the exact figures. Even rough prices beat the silent assumption of equal ones.
Watch what the arithmetic does to the do-nothing model from the evaluation lesson: 99% accurate, and the most expensive policy on the table, because all ten of the dearest errors are its.
This is the number that lets engineering and the business argue in the same units. 'Policy B has the worst precision and saves 150 per thousand transactions' is a decision; two duelling metrics are not.
Figure. Expected cost per 1,000 transactions at miss = 500, false alarm = 5. The 99%-accurate do-nothing policy is five times the price of the noisy policy B; accuracy ranked these three exactly backwards.
Three policies, priced
1,000 transactions, 10 frauds. A missed fraud costs 500 units; a false alarm costs 5 (a human review). Policy A misses 2 frauds and raises 30 false alarms; policy B misses none and raises 200; doing nothing misses all 10.
- Do nothing = 10 × 5005,000
- Policy A = 2 × 500 + 30 × 51,150
- Policy B = 0 × 500 + 200 × 51,000
- Cheapest policyB — the noisiest one
Pro tip. Policy B has the worst precision of the three and is still the right choice at these prices. Reverse the prices — false alarms at 500, misses at 5 — and doing nothing wins. The ranking of models is a function of the cost matrix, not of the models alone.
4The threshold is the decision
A scoring model ends in a number between 0 and 1; the system acts when the score crosses a threshold. The 0.5 default encodes the claim that both errors cost the same — a claim nobody at the design meeting actually made.
Moving the threshold is the trade: lower it and the system flags more, so recall rises and false alarms rise with it; raise it and the reverse. The whole precision-recall trade-off of the evaluation lesson is operated by this one number.
With prices on the errors, the right threshold stops being taste. Flag a case when the expected cost of ignoring it exceeds the expected cost of flagging it: with fraud probability p, flag when p \times 500 > (1 - p) \times 5. The algebra puts the break-even at p = 5/505 — about 1%.
That is not a rounding curiosity; it is the lesson. When misses cost a hundred times false alarms, the rational system acts on 1% suspicions — and a 0.5 threshold silently discards every fraud the model scored between 1% and 49%, which is most of them.
Figure. The probability line with both cuts drawn to scale. At miss = 500 and false alarm = 5, the rational threshold sits at about 0.01 — the far left. Everything between the two ticks is a fraud suspicion the 0.5 default throws away.
Deriving the break-even threshold
A miss costs 500; a false alarm costs 5. At what fraud probability p does flagging become worth it?
- Flag when p × 500 > (1 − p) × 5the break-even condition
- 500p > 5 − 5p → 505p > 5p > 5/505
- 5 / 505≈ 0.0099 — about 1%
- Frauds scored 0.01–0.49 under a 0.5 thresholdall ignored
Pro tip. General form: flag when p > C_fp / (C_fp + C_fn). Sanity-check it at the ends — equal costs give exactly 0.5, and as misses get dearer the threshold slides toward zero.
Coding lab. Price two thresholds runs in the app, with checks on your output.
5Writing the cost matrix is the ethics
The threshold formula is only as legitimate as the prices fed into it, and the prices are not measurements — they are commitments. Whose loss counts, in what units, decided by whom: writing the cost matrix is where a value judgement is converted into arithmetic, and pretending otherwise just hides the judgement inside a constant.
The costs differ by stakeholder. To the lender, a refused reliable applicant is a little lost interest; to the applicant it is the house. A threshold tuned to the lender's ledger and a threshold tuned to the applicant's are different numbers, and the system can only run one of them.
Some costs resist a common unit entirely — money against health, one person's privacy against another's convenience. When the units are incommensurable, the threshold is a policy choice wearing arithmetic's clothes, and the honest move is to surface it for an explicit decision rather than bury it in a config file.
The practical discipline: write the matrix down, name whose costs each cell uses, get the asymmetry ratio agreed by someone accountable for the harm, and revisit it — costs drift as products and laws change, even when the model does not.
Figure. One error cell, two prices: the lender's lost interest and the applicant's house. The matrix can hold only one of them, and the threshold formula is fed exactly that one.
Making the prices explicit
- ElicitPut a number, however rough, on each error cell — refusing to estimate is itself a choice of equal costs.
- AttributeWrite whose loss each number counts; a cell often has two candidates and the matrix can only hold one.
- Decide openlyHave the ratio approved by someone accountable for the harm, and record it beside the model version.
Notes
- Error asymmetry, expected cost, thresholds and who bears the harm.
- The 0.5 threshold silently claims both errors cost the same.
- Price the errors and rank policies by expected cost, not accuracy.
Formulas
- Expected cost = FN × C_miss + FP × C_alarm
- Flag when p > C_fp / (C_fp + C_fn)
Exam traps & shortcuts
- The 0.5 threshold is a default, not a decision — derive the threshold from the two error costs.
- Ask who bears each error before comparing models; the cheaper model for the firm can be the dearer one for the applicant.
Recap
This lesson in brief:
- Two errors, two prices
- False positives and false negatives land on different parties with different force; symmetric metrics assume they do not.
- Impact questions
- Who is scored, who bears each error, what recourse exists — design inputs, not an audit at the end.
- Expected cost
- Price the cells and the 99%-accurate do-nothing model becomes the most expensive policy on the table.
- The threshold
- Flag when p > C_fp/(C_fp + C_fn) — at a 100:1 cost ratio the rational threshold sits near 1%, not 0.5.
Practise Cost-Sensitive Decisions
Reading is free and needs no account. Practice, mocks and progress live in the app.
- 1 quick check with worked explanations
- Timed mocks scored with the real marking scheme
- Readiness tracked per topic, kept on your device