Skip to content
ML Academy

Classical ML, validation, metrics, interpretation, debugging · insight-0154

Tune the threshold on cross-validated or fresh validation predictions, never on training predictions

Evidence type
documented fact
Difficulty
medium
Roles
Data scientist, ML engineer
Industries
insurance, cross-industry

Summary: situation, action, reason, boundary

  1. Situation

    You search thresholds to maximize a business metric such as profit or F-beta.

  2. Action

    Use TunedThresholdClassifierCV with a business scorer, or tune on a separate validation set, and report the final threshold's performance on an untouched test set.

  3. Reason

    The threshold is a fitted parameter; tuning it on the same data used to fit the model overfits like any other hyperparameter.

  4. Boundary

    Binary classifiers whose operating point is chosen from data.

Symptom or risk

Thresholds tuned on training-set scores fit overconfident in-sample predictions and fail on new data.

Exceptions

A threshold fixed by policy (regulation or a contractual service level) is not tuned and needs only verification.

Trade-offs

Internal cross-validation costs refits; prefit mode is cheaper but needs a genuinely new validation set.

Pitfalls

Using a scorer with the wrong positive label; built-in scorers assume the default positive class.

Lessons and concepts

Claims and their sources