FAILURE MAP
← Case archive

FA-100016 / Evaluation metric aggregation / Open access

Threshold sweep reuses the previous threshold counts · case 01

Threshold sweep reuses the previous threshold counts.

Verified by executionVariant 1 · 6 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

A boundary prediction is counted in consecutive threshold buckets.

THE FAILURE

A boundary prediction is counted in consecutive threshold buckets.

Unsuccessful approach: Using strict greater-than drops examples exactly on the threshold.

Case contract

Return [TP,FP] for each supplied threshold, counting scores >= threshold; order matches thresholds.

Why this case matters

A small explicit evaluation contract makes aggregation behavior reproducible across labeled examples.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(truth, scores, thresholds):
    counts=[]; tp=fp=0
    for t in thresholds:
        tp+=sum(a==1 and s>=t for a,s in zip(truth,scores)); fp+=sum(a==0 and s>=t for a,s in zip(truth,scores)); counts.append([tp,fp])
    return counts
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two cutoffs',solve([1,0,1],[N, N+1, N-1],[N,N+1]),[[1,1],[0,1]])
check('exact boundary',solve([1,0],[N,N],[N]),[[1,1]])
check('high cutoff',solve([1],[N],[N+1]),[[0,0]])
check('empty cutoffs',solve([1],[N],[]),[])
check('empty examples',solve([],[],[0,N]),[[0,0],[0,0]])
check('lower threshold',solve([1,0],[N,0],[0]),[[1,1]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
two cutoffs[[1, 1], [1, 2]][[1, 1], [0, 1]]Failed
exact boundary[[1, 1]][[1, 1]]Passed
high cutoff[[0, 0]][[0, 0]]Passed
empty cutoffs[][]Passed
empty examples[[0, 0], [0, 0]][[0, 0], [0, 0]]Passed
lower threshold[[1, 1]][[1, 1]]Passed

SHA-256 / 85c47ca67c1d0d6a70c8f508f813d187d7f4d8023ecbbc5d57ddc0e854928359

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(truth, scores, thresholds):
    return [[sum(a==1 and s>t for a,s in zip(truth,scores)),sum(a==0 and s>t for a,s in zip(truth,scores))] for t in thresholds]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('two cutoffs',solve([1,0,1],[N, N+1, N-1],[N,N+1]),[[1,1],[0,1]])
check('exact boundary',solve([1,0],[N,N],[N]),[[1,1]])
check('high cutoff',solve([1],[N],[N+1]),[[0,0]])
check('empty cutoffs',solve([1],[N],[]),[])
check('empty examples',solve([],[],[0,N]),[[0,0],[0,0]])
check('lower threshold',solve([1,0],[N,0],[0]),[[1,1]])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
two cutoffs[[0, 1], [0, 0]][[1, 1], [0, 1]]Failed
exact boundary[[0, 0]][[1, 1]]Failed
high cutoff[[0, 0]][[0, 0]]Passed
empty cutoffs[][]Passed
empty examples[[0, 0], [0, 0]][[0, 0], [0, 0]]Passed
lower threshold[[1, 0]][[1, 1]]Failed

SHA-256 / 48026e40ca3b93837e11f2174434bd4f5af3cf8d3a5e58b5798140b17e360172

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 6 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

Inputs are finite toy labels and scores; this defines no benchmark protocol, production metric library, or model quality claim. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-30T16:48:30.810551+00:00.

Case digest / 515b42d1bec6099dbf94d21208dfaf1851c030b80f490930f5c0b946b9776a55