FA-100031 / Evaluation metric aggregation / Open access
Multiclass MCC reports accuracy instead of correlation · case 01
Multiclass MCC reports accuracy instead of correlation.
ROOT CAUSE
The evaluator reports the diagonal fraction and loses the predicted and actual class marginals.
THE FAILURE
The evaluator reports the diagonal fraction and loses the predicted and actual class marginals.
Unsuccessful approach: Dividing the covariance numerator by squared sample count fails to normalize by class marginals.
Case contract
Return multiclass Matthews correlation coefficient for the supplied label set using the confusion-matrix formula; zero denominator yields 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(a==b for a,b in zip(truth,pred))/len(truth) if truth else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('binary perfect',solve([0,1],[0,1],[0,1]),1)
check('binary inverse',solve([0,1],[1,0],[0,1]),-1)
check('constant prediction',solve([0,1],[0,0],[0,1]),0)
check('empty',solve([],[],[0,1]),0)
check('three-class perfect',solve([0,1,2],[0,1,2],[0,1,2]),1)
check('three-class cycle',solve([0,1,2],[1,2,0],[0,1,2]),-.5)
check('unbalanced binary',solve([0,0,1,1,1],[0,1,1,1,1],[0,1]),3/(24**0.5))
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 |
|---|---|---|---|
| binary perfect | 1.0 | 1 | Passed |
| binary inverse | 0.0 | -1 | Failed |
| constant prediction | 0.5 | 0 | Failed |
| empty | 0 | 0 | Passed |
| three-class perfect | 1.0 | 1 | Passed |
| three-class cycle | 0.0 | -0.5 | Failed |
| unbalanced binary | 0.8 | 0.6123724356957946 | Failed |
SHA-256 / 33c6174dcd18aac3661d773b44decc8300e03179c08db4b298d51e0492ab5342
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(truth, pred, labels):
from math import sqrt
C=[[sum(a==i and b==j for a,b in zip(truth,pred)) for j in labels] for i in labels]; s=sum(map(sum,C)); c=sum(C[i][i] for i in range(len(labels))); r=[sum(row) for row in C]; q=[sum(C[i][j] for i in range(len(labels))) for j in range(len(labels))]; numerator=c*s-sum(x*y for x,y in zip(q,r)); return numerator/(s*s) if s else 0
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('binary perfect',solve([0,1],[0,1],[0,1]),1)
check('binary inverse',solve([0,1],[1,0],[0,1]),-1)
check('constant prediction',solve([0,1],[0,0],[0,1]),0)
check('empty',solve([],[],[0,1]),0)
check('three-class perfect',solve([0,1,2],[0,1,2],[0,1,2]),1)
check('three-class cycle',solve([0,1,2],[1,2,0],[0,1,2]),-.5)
check('unbalanced binary',solve([0,0,1,1,1],[0,1,1,1,1],[0,1]),3/(24**0.5))
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 |
|---|---|---|---|
| binary perfect | 0.5 | 1 | Failed |
| binary inverse | -0.5 | -1 | Failed |
| constant prediction | 0.0 | 0 | Passed |
| empty | 0 | 0 | Passed |
| three-class perfect | 0.6666666666666666 | 1 | Failed |
| three-class cycle | -0.3333333333333333 | -0.5 | Failed |
| unbalanced binary | 0.24 | 0.6123724356957946 | Failed |
SHA-256 / 05bda0f8cab95b8c9ec7b5db747837f347aaf456c0a41381f2fac08bede3e31b
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 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.810501+00:00.
Case digest / 648dfbfe1f6ab11672b973db01f105cc3d160c09663c28b0d56aa1c493af1320