FA-99951 / Evaluation metric aggregation / Open access
Macro recall weights labels by support · case 01
Macro recall weights labels by support.
ROOT CAUSE
Recall values are pooled through their counts, giving common labels extra weight.
THE FAILURE
Recall values are pooled through their counts, giving common labels extra weight.
Unsuccessful approach: Including absent labels as zero changes the explicitly requested label set.
Case contract
Average per-label recall over the supplied labels; a label with no actual examples has recall 0; empty label list returns 0.
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, pred, labels):
return sum(sum(a==k and b==k for a,b in zip(truth,pred))/sum(a==k for a in truth) if sum(a==k for a in truth) else 0 for k in labels)/len(truth) if truth else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal supports',solve([0,0,0,1],[0,0,1,1],[0,1]),(2/3+1)/2)
check('perfect',solve([0,1],[0,1],[0,1]),1)
check('absent requested label',solve([0],[0],[0,1]),.5)
check('empty labels',solve([0],[0],[]),0)
check('empty data',solve([],[],[0,1]),0)
check('all missed',solve([N]*N,[0]*N,[N]),0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unequal supports | 0.41666666666666663 | 0.8333333333333333 | Failed |
| perfect | 1.0 | 1 | Passed |
| absent requested label | 1.0 | 0.5 | Failed |
| empty labels | 0.0 | 0 | Passed |
| empty data | 0 | 0 | Passed |
| all missed | 0.0 | 0 | Passed |
SHA-256 / 19468ae21d0a8fc50ac823f07d527560df3bcb68e71ea8f618c211aeeee122df
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(truth, pred, labels):
return sum(sum(a==k and b==k for a,b in zip(truth,pred))/sum(a==k for a in truth) if sum(a==k for a in truth) else 0 for k in labels+[99])/len(labels+[99]) if labels else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('unequal supports',solve([0,0,0,1],[0,0,1,1],[0,1]),(2/3+1)/2)
check('perfect',solve([0,1],[0,1],[0,1]),1)
check('absent requested label',solve([0],[0],[0,1]),.5)
check('empty labels',solve([0],[0],[]),0)
check('empty data',solve([],[],[0,1]),0)
check('all missed',solve([N]*N,[0]*N,[N]),0)
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| unequal supports | 0.5555555555555555 | 0.8333333333333333 | Failed |
| perfect | 0.6666666666666666 | 1 | Failed |
| absent requested label | 0.3333333333333333 | 0.5 | Failed |
| empty labels | 0 | 0 | Passed |
| empty data | 0.0 | 0 | Passed |
| all missed | 0.0 | 0 | Passed |
SHA-256 / b7acf85d2f849dcfb206243ee2a04c3841d381be832641f751b2d237ba9ee7a0
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:29.887515+00:00.
Case digest / 03d4143ffc9590389af19339540ae92711308991309b9ecbdc35b44703d317f4