Who decided that 0.5 was the right threshold?

Choose decisions by error costs, calibration and capacity

The same model can justify different thresholds when error costs change. Calibration and review capacity belong in the decision.

A model assigns scores. A product decides what to do with them. Changing the decision threshold can change the product without changing a single model weight.

Begin with precision, recall and rare events.

One model, two policies

Suppose a validation set contains 100 faults and 9,900 normal images. The following are illustrative measurements at two thresholds:

| Policy | TP | FN | FP | TN | Alerts | |---|---:|---:|---:|---:|---:| | Higher threshold | 60 | 40 | 20 | 9,880 | 80 | | Lower threshold | 90 | 10 | 300 | 9,600 | 390 |

Lowering a threshold expands the positive set. On the same fixed dataset recall cannot decrease, but precision need not move monotonically at every step.

Which policy is better depends on the consequences.

Price the mistakes

Assume correct decisions cost zero and error costs add:

Cost = FP × CFP + FN × CFN

If a false alert costs 1 and a missed fault costs 50, the high threshold costs 20+40×50 = 2,020 units. The low threshold costs 300+10×50 = 800.

If a miss costs only 5, the costs become 220 and 350. The preferred policy reverses while the model stays unchanged.

Derive a probability threshold

Assume p is an appropriate probability of a fault. Alerting has expected error cost (1-p)×CFP; not alerting costs p×CFN. Alert when:

At costs 1 and 50 this is about 1.96%, not 50%. At equality either action has the same expected cost under these assumptions.

This calculation requires suitable probabilities, fixed costs and zero cost for correct decisions. It is not a universal configuration value.

A score in [0,1] is not enough

Calibration concerns how predicted probabilities match observed frequencies. A score useful for ranking is not automatically a probability suitable for that formula. You can still select thresholds empirically on validation data by measured cost.

Capacity adds another constraint: a team able to inspect 100 alerts cannot simply adopt a policy producing 390. Severity, changing costs and operator load may require a richer decision policy.

Choose on validation data or suitable cross-validation. Repeatedly tuning against the test set turns the final evaluation into part of model selection.

Check yourself

If the false-alert cost doubles while the missed-fault cost stays fixed, the simple threshold rises. Verify the resulting workload and error costs on representative data.

Version the threshold policy alongside the model. A model file alone does not describe the deployed decision system.

Tagged: ai, evaluation, thresholds, calibration

Area: AI

Related notes

עברית