{"abstract":"Mean imputation applies fitted state incorrectly.","category":"Feature preprocessing fit scope","checks":7,"contract":"Train and transform are row lists of one numeric feature with None missing. Fit the arithmetic mean of observed training values (0 when none); replace transform missing values only.","contract_signature":"train, rows","evaluation_group":"w3-feature-preprocessing-fit-scope-mean-imputation","failed_approach":"The partial repair addresses the main convention but mishandles an edge case.","family":"w3-feature-preprocessing-fit-scope-mean-imputation-transform-state","id":"FA-100346","implementations":{"attempt":{"sha256":"d98378d6a8c15d86262ecde782478dc09bd43917a77183638c3605311120e3c6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, rows):\n    v=[x for row in train for x in row if x is not None]; m=v[0] if v else 0\n    return [[m if x is None else x for x in row] for row in rows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na=[[None,2+N],[4+N,None]]; check('two gaps',solve([[1+N],[3+N]],a),[[2+N,2+N],[4+N,2+N]])\ncheck('heldout cannot move mean',solve([[2+N]],[[None]]),[[2+N]])\ncheck('all missing fit',solve([[None]],[[None,7]]),[[0,7]])\ncheck('no missing values',solve([[2]],[[N,3]]),[[N,3]])\ncheck('empty transform',solve([[2]],[]),[])\ncheck('negative training mean',solve([[-N,-N-2]],[[None]]),[[-N-1]])\ncheck('singleton fit',solve([[N]],[[None]]),[[N]])\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":"a49d91581ab48cf8f398a963f5e82771753f2f8b5b09d5412422e72005b964e2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, rows):\n    m=sum(x for row in train for x in row if x is not None)/sum(x is not None for row in train for x in row) if any(cell is not None for row in train for cell in row) else 0\n    return [[0 if x is None else x for x in row] for row in rows]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na=[[None,2+N],[4+N,None]]; check('two gaps',solve([[1+N],[3+N]],a),[[2+N,2+N],[4+N,2+N]])\ncheck('heldout cannot move mean',solve([[2+N]],[[None]]),[[2+N]])\ncheck('all missing fit',solve([[None]],[[None,7]]),[[0,7]])\ncheck('no missing values',solve([[2]],[[N,3]]),[[N,3]])\ncheck('empty transform',solve([[2]],[]),[])\ncheck('negative training mean',solve([[-N,-N-2]],[[None]]),[[-N-1]])\ncheck('singleton fit',solve([[N]],[[None]]),[[N]])\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":"Toy one-column numeric imputer; no dataframe, dtype, or multi-column behavior is implied. 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-feature-preprocessing-fit-scope-mean-imputation-transform-state","generated_at":"2026-09-30T16:48:34.472005+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A small deterministic preprocessing contract makes the fit boundary and transform behavior directly inspectable.","root_cause":"The transform applies a plausible but incorrect state convention.","sha256":"699e8690d43f77c9fc71603176db8b51219fb8c706ea175f8ada41e14904cc10","title":"Mean imputation applies fitted state incorrectly · 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":27.583,"exit_code":1,"observations":[{"actual":[[2,3],[5,2]],"check":"two gaps","expected":[[3,3],[5,3]],"passed":false},{"actual":[[3]],"check":"heldout cannot move mean","expected":[[3]],"passed":true},{"actual":[[0,7]],"check":"all missing fit","expected":[[0,7]],"passed":true},{"actual":[[1,3]],"check":"no missing values","expected":[[1,3]],"passed":true},{"actual":[],"check":"empty transform","expected":[],"passed":true},{"actual":[[-1]],"check":"negative training mean","expected":[[-2]],"passed":false},{"actual":[[1]],"check":"singleton fit","expected":[[1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two gaps\", \"actual\": [[2, 3], [5, 2]], \"expected\": [[3, 3], [5, 3]], \"passed\": false}, {\"check\": \"heldout cannot move mean\", \"actual\": [[3]], \"expected\": [[3]], \"passed\": true}, {\"check\": \"all missing fit\", \"actual\": [[0, 7]], \"expected\": [[0, 7]], \"passed\": true}, {\"check\": \"no missing values\", \"actual\": [[1, 3]], \"expected\": [[1, 3]], \"passed\": true}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"negative training mean\", \"actual\": [[-1]], \"expected\": [[-2]], \"passed\": false}, {\"check\": \"singleton fit\", \"actual\": [[1]], \"expected\": [[1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.381,"exit_code":1,"observations":[{"actual":[[0,3],[5,0]],"check":"two gaps","expected":[[3,3],[5,3]],"passed":false},{"actual":[[0]],"check":"heldout cannot move mean","expected":[[3]],"passed":false},{"actual":[[0,7]],"check":"all missing fit","expected":[[0,7]],"passed":true},{"actual":[[1,3]],"check":"no missing values","expected":[[1,3]],"passed":true},{"actual":[],"check":"empty transform","expected":[],"passed":true},{"actual":[[0]],"check":"negative training mean","expected":[[-2]],"passed":false},{"actual":[[0]],"check":"singleton fit","expected":[[1]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two gaps\", \"actual\": [[0, 3], [5, 0]], \"expected\": [[3, 3], [5, 3]], \"passed\": false}, {\"check\": \"heldout cannot move mean\", \"actual\": [[0]], \"expected\": [[3]], \"passed\": false}, {\"check\": \"all missing fit\", \"actual\": [[0, 7]], \"expected\": [[0, 7]], \"passed\": true}, {\"check\": \"no missing values\", \"actual\": [[1, 3]], \"expected\": [[1, 3]], \"passed\": true}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"negative training mean\", \"actual\": [[0]], \"expected\": [[-2]], \"passed\": false}, {\"check\": \"singleton fit\", \"actual\": [[0]], \"expected\": [[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."}}