{"abstract":"Grouped accuracy includes empty groups as zero.","category":"Evaluation metric aggregation","checks":6,"contract":"Rows are [group,truth,prediction]. Return the unweighted mean accuracy among requested groups represented by rows; no represented requested groups yields 0.","contract_signature":"rows, groups","evaluation_group":"w3-eval-group-support-filter","failed_approach":"Weighting each group score by its row count turns the requested group mean into pooled accuracy.","family":"w3-evaluation-metric-aggregation-group-support-filter","id":"FA-100021","implementations":{"attempt":{"sha256":"cbd3d4c26ea2460a61b3ee6a298636fba7a64a696fd8965eb016504c1177ae0f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, groups):\n    present=sorted({g for g,_,_ in rows}); return sum(sum(t==p for g,t,p in rows if g==x)/sum(g==x for g,t,p in rows) for x in present)/len(groups) if groups else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty requested group',solve([['a',1,1]],['a','b']),1)\ncheck('unequal groups',solve([['a',1,1]]*N+[['b',0,1]],['a','b']),.5)\ncheck('all empty',solve([],['a','b']),0)\ncheck('no group names',solve([['a',1,1]],[]),0)\ncheck('single represented',solve([['x',0,1]],['x']),0)\ncheck('unlisted row ignored',solve([['x',1,1]],['a']),0)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"05620536c8a96685b127e36e4f969ad506c8de264b5d19f32acea5e52e4f80bf","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows, groups):\n    return sum(sum(t==p for g,t,p in rows if g==x)/sum(g==x for g,t,p in rows) if any(g==x for g,_,_ in rows) else 0 for x in groups)/len(groups) if groups else 0\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('empty requested group',solve([['a',1,1]],['a','b']),1)\ncheck('unequal groups',solve([['a',1,1]]*N+[['b',0,1]],['a','b']),.5)\ncheck('all empty',solve([],['a','b']),0)\ncheck('no group names',solve([['a',1,1]],[]),0)\ncheck('single represented',solve([['x',0,1]],['x']),0)\ncheck('unlisted row ignored',solve([['x',1,1]],['a']),0)\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":"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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"w3-evaluation-metric-aggregation-group-support-filter","generated_at":"2026-09-30T16:48:30.810585+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small explicit evaluation contract makes aggregation behavior reproducible across labeled examples.","root_cause":"Groups with no evaluation rows are inserted into the average with zero score.","sha256":"e7b18c6a80189dedde80a6cb8a1909ad22bfa5b2ae6a605ab774b78ac715178f","title":"Grouped accuracy includes empty groups as zero · case 01","variant":1,"variant_policy":"The fixture code references N, supplied as 1 through 5. Fixed boundary checks may repeat. These records share one mechanism and must remain together in evaluation splits.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":29.547,"exit_code":1,"observations":[{"actual":0.5,"check":"empty requested group","expected":1,"passed":false},{"actual":0.5,"check":"unequal groups","expected":0.5,"passed":true},{"actual":0.0,"check":"all empty","expected":0,"passed":true},{"actual":0,"check":"no group names","expected":0,"passed":true},{"actual":0.0,"check":"single represented","expected":0,"passed":true},{"actual":1.0,"check":"unlisted row ignored","expected":0,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty requested group\", \"actual\": 0.5, \"expected\": 1, \"passed\": false}, {\"check\": \"unequal groups\", \"actual\": 0.5, \"expected\": 0.5, \"passed\": true}, {\"check\": \"all empty\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}, {\"check\": \"no group names\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"single represented\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}, {\"check\": \"unlisted row ignored\", \"actual\": 1.0, \"expected\": 0, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.541,"exit_code":1,"observations":[{"actual":0.5,"check":"empty requested group","expected":1,"passed":false},{"actual":0.5,"check":"unequal groups","expected":0.5,"passed":true},{"actual":0.0,"check":"all empty","expected":0,"passed":true},{"actual":0,"check":"no group names","expected":0,"passed":true},{"actual":0.0,"check":"single represented","expected":0,"passed":true},{"actual":0.0,"check":"unlisted row ignored","expected":0,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"empty requested group\", \"actual\": 0.5, \"expected\": 1, \"passed\": false}, {\"check\": \"unequal groups\", \"actual\": 0.5, \"expected\": 0.5, \"passed\": true}, {\"check\": \"all empty\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}, {\"check\": \"no group names\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"single represented\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}, {\"check\": \"unlisted row ignored\", \"actual\": 0.0, \"expected\": 0, \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}