Knowledge Institute · 8–10 minutes with practice

Choose a classifier threshold with a realistic account of errors

Compare settings on the same held-out records using the cost of missed cases and unnecessary reviews.

Digital Business & Operations Quick Courses

Learning objectives

Learn

A classifier score can rank cases without giving a reliable probability. A threshold turns a score into an action or label. Select it using outcomes, available review capacity, and the consequences of false positives and false negatives. A separate comparison is needed to evaluate the chosen policy fairly.

Problem formulation, baselines and honest experiments

An experiment compares complete learning procedures, not isolated model names. The baseline and candidate must share the prediction timestamp, allowed features, target definition, evaluation cases and metric. A simple baseline can be strong when most variation is predictable from a stable group or season. A complex candidate can appear superior by using information unavailable when the decision must be made.

Separate fitting, model selection and final evaluation. Hyperparameters chosen after looking at test results make those results development evidence. Reproducibility includes the split rule and selection history, not just a seed.

Linear and logistic models, regularization and calibration

A logistic model computes a score z, transforms it with a sigmoid and applies a chosen threshold for a decision. These are three distinct objects. A sigmoid maps numbers into (0,1), but that range alone does not establish calibration. A set of predictions near .8 is calibrated only if the relevant outcome occurs about 80% of the time in the defined setting, subject to sampling uncertainty.

Changing the threshold changes sensitivity and false alerts without changing the fitted probability model. Regularization constrains fitting; it does not select a universally correct operational threshold. Use numerically stable sigmoid evaluation and assess calibration on data independent of fitting.

  1. The .9 error does not alone prove global miscalibration. Assess calibration across enough cases and relevant subgroups rather than interpreting a single probability as certainty.

Failure-oriented laboratory: Thresholds, calibration and a held-out decision audit

A predictive score is not a decision rule. A threshold converts a score into action and therefore trades false positives against false negatives. Choose it using a development process aligned with stated costs and capacity, then evaluate it once on held-out evidence. Repeatedly adjusting the threshold after inspecting test errors consumes the independence of that test.

Precision answers how many selected positives are correct; recall answers how many actual positives were selected. Neither establishes calibrated probabilities. Calibration compares predicted probabilities with observed frequencies among comparable predictions, and its assessment requires sample size and uncertainty. A model can rank cases well while reporting unreliable probabilities.

Report counts before ratios, including abstentions and unscored cases. Subgroup or time-slice results can reveal concentrated failure, but tiny samples do not support precise claims. Monitor the consequences of decisions, not only model scores, and preserve a non-model baseline. This laboratory uses fictional labels and does not authorize decisions about real people.

Model comparison, drift and deployment decisions

Evaluation describes a model under a particular data-generation and decision setting. Feature checks can reject values outside a contract, while distribution shift can occur entirely inside those ranges. Monitor data, predictions and outcomes where outcomes become available, and specify actions for suspected degradation. A model version change can alter behavior even when application code is unchanged.

A release decision should compare a baseline, candidate performance, operational costs and failure cases. Preserve a fallback, record versions and use a rollback trigger tied to observed behavior. Absence of an alarm is not proof that the system remains valid.

Apply

A fictional manufacturing review has 50 defective items among 500. At a lower threshold, the model flags 45 defects and 45 sound items, missing five defects. At a higher threshold it flags 40 defects and 10 sound items, missing ten. If each missed defect costs $20 and each false flag costs $4 in the simplified model, the estimated costs are $280 and $240. That result is conditional on the stated cost and review rule. It leaves uncertainty from finite samples and changing prevalence, and it does not make the reported scores probabilities.

For a calibration check, group many sufficiently comparable cases by their predicted probability and compare each group’s average prediction with its observed outcome rate. A model could order the same items well while overstating the chance of a defect on each item. Calibration, ranking, and the final decision rule call for distinct checks. A failure at one task may suggest repair without proving failure at all three.

Optional check

If the cost of missing a defect doubles while other stipulated costs stay fixed, which threshold has lower loss in the toy comparison?

Show the explained answer

The lower threshold costs $380 and the higher costs $440. Choose settings against the actual objective and verify the choice in suitable evaluation data.

Sources and further reading

Continue in Lawfare Academy

Full course · AI 301 — Machine Learning, Neural Networks and Language