Exercise 2: Two More Tried Values — Possible Solution ==================================================================== EXTENDED DATA ------------------------------ threshold_results = { 0.3: {'recall': 0.95, 'false_positive_rate': 0.40}, 0.5: {'recall': 0.80, 'false_positive_rate': 0.15}, 0.55: {'recall': 0.75, 'false_positive_rate': 0.10}, 0.65: {'recall': 0.60, 'false_positive_rate': 0.05}, 0.7: {'recall': 0.55, 'false_positive_rate': 0.04}, } exploration_order = [0.3, 0.5, 0.55, 0.7, 0.65] RESULTS ------------------------------ tried 0.3: fpr=0.40 -> current best: 0.3 tried 0.5: fpr=0.15 -> current best: 0.5 (rewrite 1) tried 0.55: fpr=0.10 -> current best: 0.55 (rewrite 2) tried 0.7: fpr=0.04 -> current best: 0.7 (rewrite 3) tried 0.65: fpr=0.05 -> current best: 0.7 (no rewrite - 0.65 is worse than 0.7) Total test rewrites with 5 tried values: 3 (the chapter's own 3-value exploration needed 2 rewrites) WHY THIS WORKS AS AN ANSWER ------------------------------ Adding more explored values increased the rewrite count from 2 to 3 - not because the underlying problem changed, but because trying more candidate thresholds naturally means more chances to find a better one partway through. The one value that DIDN'T cause a rewrite (0.65, tried last) illustrates the flip side: exploration doesn't always improve on the current best, and a TDD-first test would have been correct not to change on that particular attempt. This confirms the chapter's own point scales with how much genuine exploration a task actually requires - the more open-ended the search, the more a test-first assertion has to be rewritten along the way.