liveBook · Manning

Threshold

As explained in Vibe Engineering

A classification threshold is the score cutoff used to convert a model's continuous output into a discrete class decision.

A classification threshold converts a model’s score into a class decision. A default cutoff of 0.5 can miss a high-risk case: a medicine scored 0.21 and was classified LOW RISK despite being a high-risk example. The score and the decision are different outputs; the cutoff determines how the score is used. section 4.6.4

Listing 4.10 Classification output
========== FINAL MODEL DEMO ==========
--- LOW RISK EXAMPLE ---
Risk Probability: 0.07
Predicted Risk Level: LOW RISK ✅
--- HIGH RISK EXAMPLE ---
Risk Probability: 0.21
Predicted Risk Level: LOW RISK ✅

The two predictions show how a 0.5 cutoff produces a low-risk decision for both examples. section 4.6.4

Lowering the threshold marks more cases as high risk, potentially catching more actual risks but also increasing false positives. Raising it shifts more predictions to low risk and may miss real risks. For example, 0.31 is high risk at a 0.3 cutoff, while 0.55 is low risk at a 0.6 cutoff. section 4.6.5

Choose a cutoff against the consequences of missed risks and false alarms, rather than treating 0.5 as inherently correct. Plotting precision and recall across thresholds makes the tradeoff visible; an F1-based balance is another selection criterion, not a substitute for deciding which errors matter most. section 4.6.5 section 4.7

Figure 4.11 Precision vs. Recall at Different Thresholds.

The plot compares precision and recall at different thresholds. section 4.6.5

Changing the cutoff and the inputs

A later demonstration uses a 0.3 threshold and shorter descriptions. It reports 0.01 for the low-risk example and 0.82 for the high-risk example, classifying both as intended. Because the inputs and threshold both changed, this comparison alone does not isolate the effect of lowering the cutoff. section 4.6.4

How Vibe Engineering covers it

How deep it goes
Explains cutoff tradeoffs and visualizes precision and recall across thresholds, with an F1-based balance as a selection criterion.
Examples
Uses medicine descriptions and side effects to compare risk predictions at 0.5 and 0.3 cutoffs.
What you can do after
Evaluate threshold choices using precision and recall while weighing missed risks against false alarms.
How it connects
Connects classification to precision, recall, false positives, false negatives, and F1 score.

Also explained in

Compare how 20 books explain threshold →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of Vibe Engineering. The section links point to the parts of the book it draws on.