{"abstract":"Mean imputation uses held-out rows while fitting.","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":"Filtering rows after computing the statistic still leaves held-out influence.","family":"w3-feature-preprocessing-fit-scope-mean-imputation-fit-leakage","id":"FA-100341","implementations":{"attempt":{"sha256":"ab22fefe506b8091462220508e569c47afbc7a98db39175e932092b8c6750b50","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+rows for x in row if x is not None)/sum(x is not None for row in train+rows for x in row) if any(cell is not None for row in train+rows for cell in row) 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":"e11cabd95abba7bbcab08e6e9e1cab27f826d9e11619d493f8211d937fd6a239","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, rows):\n    allv=[x for row in rows for x in row if x is not None]; m=sum(allv)/len(allv) if allv 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"}},"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-fit-leakage","generated_at":"2026-09-30T16:48:34.471828+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":"Fitting reads values outside the designated training rows.","sha256":"65aa2752a13ce3b8c1301cafec77e3f6112d2176082dcb7e6048f423d3349497","title":"Mean imputation uses held-out rows while fitting · 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":28.619,"exit_code":1,"observations":[{"actual":[[3.5,3],[5,3.5]],"check":"two gaps","expected":[[3,3],[5,3]],"passed":false},{"actual":[[3.0]],"check":"heldout cannot move mean","expected":[[3]],"passed":true},{"actual":[[7.0,7]],"check":"all missing fit","expected":[[0,7]],"passed":false},{"actual":[[1,3]],"check":"no missing values","expected":[[1,3]],"passed":true},{"actual":[],"check":"empty transform","expected":[],"passed":true},{"actual":[[-2.0]],"check":"negative training mean","expected":[[-2]],"passed":true},{"actual":[[1.0]],"check":"singleton fit","expected":[[1]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"two gaps\", \"actual\": [[3.5, 3], [5, 3.5]], \"expected\": [[3, 3], [5, 3]], \"passed\": false}, {\"check\": \"heldout cannot move mean\", \"actual\": [[3.0]], \"expected\": [[3]], \"passed\": true}, {\"check\": \"all missing fit\", \"actual\": [[7.0, 7]], \"expected\": [[0, 7]], \"passed\": false}, {\"check\": \"no missing values\", \"actual\": [[1, 3]], \"expected\": [[1, 3]], \"passed\": true}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"negative training mean\", \"actual\": [[-2.0]], \"expected\": [[-2]], \"passed\": true}, {\"check\": \"singleton fit\", \"actual\": [[1.0]], \"expected\": [[1]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.5,"exit_code":1,"observations":[{"actual":[[4.0,3],[5,4.0]],"check":"two gaps","expected":[[3,3],[5,3]],"passed":false},{"actual":[[0]],"check":"heldout cannot move mean","expected":[[3]],"passed":false},{"actual":[[7.0,7]],"check":"all missing fit","expected":[[0,7]],"passed":false},{"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\": [[4.0, 3], [5, 4.0]], \"expected\": [[3, 3], [5, 3]], \"passed\": false}, {\"check\": \"heldout cannot move mean\", \"actual\": [[0]], \"expected\": [[3]], \"passed\": false}, {\"check\": \"all missing fit\", \"actual\": [[7.0, 7]], \"expected\": [[0, 7]], \"passed\": false}, {\"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."}}