promptdojo_

Precision, recall, and threshold tradeoffs — step 6 of 7

Write report(th, scored): compute precision and recall at the threshold — guarding both zero denominators with if tp + fp else 0.0 style — and print exactly f"threshold {th:.2f} precision={prec:.0%} recall={rec:.0%}". Run it at 0.80, 0.50, and 0.05 and watch the dial trade one mistake for the other.

full-screen editor opens — close anytime to keep reading.