{"abstract":"Median imputation uses held-out rows while fitting.","category":"Feature preprocessing fit scope","checks":7,"contract":"Train and values are scalar numeric lists with optional None. Fit the ordinary median, averaging the two middle observations for even size; use zero if no observations.","contract_signature":"train, values","evaluation_group":"w3-feature-preprocessing-fit-scope-median-imputation","failed_approach":"Filtering rows after computing the statistic still leaves held-out influence.","family":"w3-feature-preprocessing-fit-scope-median-imputation-fit-leakage","id":"FA-100401","implementations":{"attempt":{"sha256":"0c0d72f0db99df614416065941d8a740726e02ca38c4e491bef34d6fe319b71c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(x for x in train+values if x is not None); m=v[len(v)//2] if v else 0; return [m if x is None else x for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('odd training',solve([1,5,9],[None,4]),[5,4])\ncheck('even training midpoint',solve([0,4],[None]),[2])\ncheck('heldout does not affect median',solve([1,7],[None,100]),[4,100])\ncheck('all missing fit',solve([None],[None]),[0])\ncheck('no gaps',solve([1,2],[8]),[8])\ncheck('singleton',solve([N],[None]),[N])\ncheck('empty transform',solve([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":"e002d04741fa6c9dde02ec8e727757f68d434bf938522b5fcf965644b1c1251d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(x for x in values if x is not None); m=v[len(v)//2] if v else 0; return [m if x is None else x for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('odd training',solve([1,5,9],[None,4]),[5,4])\ncheck('even training midpoint',solve([0,4],[None]),[2])\ncheck('heldout does not affect median',solve([1,7],[None,100]),[4,100])\ncheck('all missing fit',solve([None],[None]),[0])\ncheck('no gaps',solve([1,2],[8]),[8])\ncheck('singleton',solve([N],[None]),[N])\ncheck('empty transform',solve([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":"Toy scalar median imputer with an explicit even-sample midpoint rule. 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-median-imputation-fit-leakage","generated_at":"2026-09-30T16:48:35.337343+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":"4c3f4048109f9cce5255a50eaf0435fcd0b2592dbc9038f6d518045a0c7ac51b","title":"Median 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":25.668,"exit_code":1,"observations":[{"actual":[5,4],"check":"odd training","expected":[5,4],"passed":true},{"actual":[4],"check":"even training midpoint","expected":[2],"passed":false},{"actual":[7,100],"check":"heldout does not affect median","expected":[4,100],"passed":false},{"actual":[0],"check":"all missing fit","expected":[0],"passed":true},{"actual":[8],"check":"no gaps","expected":[8],"passed":true},{"actual":[1],"check":"singleton","expected":[1],"passed":true},{"actual":[],"check":"empty transform","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"odd training\", \"actual\": [5, 4], \"expected\": [5, 4], \"passed\": true}, {\"check\": \"even training midpoint\", \"actual\": [4], \"expected\": [2], \"passed\": false}, {\"check\": \"heldout does not affect median\", \"actual\": [7, 100], \"expected\": [4, 100], \"passed\": false}, {\"check\": \"all missing fit\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"no gaps\", \"actual\": [8], \"expected\": [8], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [1], \"expected\": [1], \"passed\": true}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":27.352,"exit_code":1,"observations":[{"actual":[4,4],"check":"odd training","expected":[5,4],"passed":false},{"actual":[0],"check":"even training midpoint","expected":[2],"passed":false},{"actual":[100,100],"check":"heldout does not affect median","expected":[4,100],"passed":false},{"actual":[0],"check":"all missing fit","expected":[0],"passed":true},{"actual":[8],"check":"no gaps","expected":[8],"passed":true},{"actual":[0],"check":"singleton","expected":[1],"passed":false},{"actual":[],"check":"empty transform","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"odd training\", \"actual\": [4, 4], \"expected\": [5, 4], \"passed\": false}, {\"check\": \"even training midpoint\", \"actual\": [0], \"expected\": [2], \"passed\": false}, {\"check\": \"heldout does not affect median\", \"actual\": [100, 100], \"expected\": [4, 100], \"passed\": false}, {\"check\": \"all missing fit\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"no gaps\", \"actual\": [8], \"expected\": [8], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [0], \"expected\": [1], \"passed\": false}, {\"check\": \"empty transform\", \"actual\": [], \"expected\": [], \"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."}}