{"abstract":"Grouped confusion counts average group matrices.","category":"Evaluation metric aggregation","checks":7,"contract":"Rows are [group,actual,predicted]; return pooled [TP,FP,FN,TN] event counts.","contract_signature":"rows","evaluation_group":"w3-eval-pooled-group-confusion","failed_approach":"Keeping only the largest per-cell group contribution loses counts from every other group.","family":"w3-evaluation-metric-aggregation-pooled-group-confusion","id":"FA-99986","implementations":{"attempt":{"sha256":"8ac7774ed86822e005dfff45b27aed9101e018f71c59e4917ad88c82c030fa69","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    groups={g for g,_,_ in rows}; tests=[(lambda a,p:a==1 and p==1),(lambda a,p:a==0 and p==1),(lambda a,p:a==1 and p==0),(lambda a,p:a==0 and p==0)]; return [max(sum(test(a,p) for gg,a,p in rows if gg==g) for g in groups) for test in tests] if groups else [0,0,0,0]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two groups',solve([['a',1,1],['b',0,1],['b',1,0],['c',0,0]]),[1,1,1,1])\ncheck('empty',solve([]),[0,0,0,0])\ncheck('single hit',solve([['a',1,1]]),[1,0,0,0])\ncheck('same cell across groups',solve([['a',1,1],['b',1,1]]),[2,0,0,0])\ncheck('repeated group',solve([['a',0,0]]*N),[0,0,0,N])\ncheck('false positives',solve([['a',0,1]]*N),[0,N,0,0])\ncheck('all cells',solve([['x',1,1],['x',1,0],['y',0,1],['y',0,0]]),[1,1,1,1])\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":"e47906a86c953201d9fa9db14157934452ff3a809a6c1161d3376d2e1cc9e56f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(rows):\n    groups={g for g,_,_ in rows}; return [sum(a==1 and p==1 for g,a,p in rows)//max(1,len(groups)),sum(a==0 and p==1 for g,a,p in rows)//max(1,len(groups)),sum(a==1 and p==0 for g,a,p in rows)//max(1,len(groups)),sum(a==0 and p==0 for g,a,p in rows)//max(1,len(groups))]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('two groups',solve([['a',1,1],['b',0,1],['b',1,0],['c',0,0]]),[1,1,1,1])\ncheck('empty',solve([]),[0,0,0,0])\ncheck('single hit',solve([['a',1,1]]),[1,0,0,0])\ncheck('same cell across groups',solve([['a',1,1],['b',1,1]]),[2,0,0,0])\ncheck('repeated group',solve([['a',0,0]]*N),[0,0,0,N])\ncheck('false positives',solve([['a',0,1]]*N),[0,N,0,0])\ncheck('all cells',solve([['x',1,1],['x',1,0],['y',0,1],['y',0,0]]),[1,1,1,1])\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-pooled-group-confusion","generated_at":"2026-09-30T16:48:30.356111+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":"Counts are divided by the number of groups even though they are event totals.","sha256":"705eb76226475c429b77dcb6f3a6916f05cc79083be2c81077f173de31e6b1eb","title":"Grouped confusion counts average group matrices · 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":30.844,"exit_code":1,"observations":[{"actual":[1,1,1,1],"check":"two groups","expected":[1,1,1,1],"passed":true},{"actual":[0,0,0,0],"check":"empty","expected":[0,0,0,0],"passed":true},{"actual":[1,0,0,0],"check":"single hit","expected":[1,0,0,0],"passed":true},{"actual":[1,0,0,0],"check":"same cell across groups","expected":[2,0,0,0],"passed":false},{"actual":[0,0,0,1],"check":"repeated group","expected":[0,0,0,1],"passed":true},{"actual":[0,1,0,0],"check":"false positives","expected":[0,1,0,0],"passed":true},{"actual":[1,1,1,1],"check":"all cells","expected":[1,1,1,1],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two groups\", \"actual\": [1, 1, 1, 1], \"expected\": [1, 1, 1, 1], \"passed\": true}, {\"check\": \"empty\", \"actual\": [0, 0, 0, 0], \"expected\": [0, 0, 0, 0], \"passed\": true}, {\"check\": \"single hit\", \"actual\": [1, 0, 0, 0], \"expected\": [1, 0, 0, 0], \"passed\": true}, {\"check\": \"same cell across groups\", \"actual\": [1, 0, 0, 0], \"expected\": [2, 0, 0, 0], \"passed\": false}, {\"check\": \"repeated group\", \"actual\": [0, 0, 0, 1], \"expected\": [0, 0, 0, 1], \"passed\": true}, {\"check\": \"false positives\", \"actual\": [0, 1, 0, 0], \"expected\": [0, 1, 0, 0], \"passed\": true}, {\"check\": \"all cells\", \"actual\": [1, 1, 1, 1], \"expected\": [1, 1, 1, 1], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.652,"exit_code":1,"observations":[{"actual":[0,0,0,0],"check":"two groups","expected":[1,1,1,1],"passed":false},{"actual":[0,0,0,0],"check":"empty","expected":[0,0,0,0],"passed":true},{"actual":[1,0,0,0],"check":"single hit","expected":[1,0,0,0],"passed":true},{"actual":[1,0,0,0],"check":"same cell across groups","expected":[2,0,0,0],"passed":false},{"actual":[0,0,0,1],"check":"repeated group","expected":[0,0,0,1],"passed":true},{"actual":[0,1,0,0],"check":"false positives","expected":[0,1,0,0],"passed":true},{"actual":[0,0,0,0],"check":"all cells","expected":[1,1,1,1],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two groups\", \"actual\": [0, 0, 0, 0], \"expected\": [1, 1, 1, 1], \"passed\": false}, {\"check\": \"empty\", \"actual\": [0, 0, 0, 0], \"expected\": [0, 0, 0, 0], \"passed\": true}, {\"check\": \"single hit\", \"actual\": [1, 0, 0, 0], \"expected\": [1, 0, 0, 0], \"passed\": true}, {\"check\": \"same cell across groups\", \"actual\": [1, 0, 0, 0], \"expected\": [2, 0, 0, 0], \"passed\": false}, {\"check\": \"repeated group\", \"actual\": [0, 0, 0, 1], \"expected\": [0, 0, 0, 1], \"passed\": true}, {\"check\": \"false positives\", \"actual\": [0, 1, 0, 0], \"expected\": [0, 1, 0, 0], \"passed\": true}, {\"check\": \"all cells\", \"actual\": [0, 0, 0, 0], \"expected\": [1, 1, 1, 1], \"passed\": false}], \"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."}}