FAILURE MAP
← Case archive

FA-100001 / Evaluation metric aggregation / Open access

Multilabel micro recall counts samples instead of labels · case 01

Multilabel micro recall counts samples instead of labels.

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

ROOT CAUSE

The numerator is the number of examples with any hit instead of matching label instances.

THE FAILURE

The numerator is the number of examples with any hit instead of matching label instances.

Unsuccessful approach: Using union size penalizes extra predictions and calculates Jaccard similarity instead.

Case contract

Return total true label instances divided by total actual label instances; empty actual label sets yield 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):
    hits=sum(bool(set(a)&set(b)) for a,b in zip(truth,pred)); total=sum(len(a) for a in truth); return hits/total if total else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiple labels',solve([[1,2,3],[4]],[[1,2],[4]]),.75)
check('extra predicted ignored',solve([[1]],[[1,2]]),1)
check('missed all',solve([[1,2]], [[]]),0)
check('empty',solve([],[]),0)
check('no true labels',solve([[]],[ [1] ]),0)
check('duplicates do not inflate',solve([[N,N]],[[N]]),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
multiple labels0.50.75Failed
extra predicted ignored1.01Passed
missed all0.00Passed
empty00Passed
no true labels00Passed
duplicates do not inflate0.51Failed

SHA-256 / 0849b27f0eba96a34a645a662faacf9ff16e4977ab3fe101a558587f429723ed

2 / The unsuccessful fix

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

N = 1
observations = []
def solve(truth, pred):
    hits=sum(len(set(a)&set(b)) for a,b in zip(truth,pred)); total=sum(len(set(a)|set(b)) for a,b in zip(truth,pred)); return hits/total if total else 0
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('multiple labels',solve([[1,2,3],[4]],[[1,2],[4]]),.75)
check('extra predicted ignored',solve([[1]],[[1,2]]),1)
check('missed all',solve([[1,2]], [[]]),0)
check('empty',solve([],[]),0)
check('no true labels',solve([[]],[ [1] ]),0)
check('duplicates do not inflate',solve([[N,N]],[[N]]),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
multiple labels0.750.75Passed
extra predicted ignored0.51Failed
missed all0.00Passed
empty00Passed
no true labels0.00Passed
duplicates do not inflate1.01Passed

SHA-256 / e469fc79d2c9c9f48dd27116e6473da9d5c1c0511accb5ffb177e06beb55dee7

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.810285+00:00.

Case digest / aaad5df355f16e2023b5e7ee334f2cd907685311e6696a2abea4d3f91bf33935