{"abstract":"Median and interquartile scaling applies fitted state incorrectly.","category":"Feature preprocessing fit scope","checks":7,"contract":"Use linear-interpolated quartiles at positions p*(n-1), median at p=.5, and scale by Q3-Q1. A zero IQR maps all values to zero. Round to six decimals.","contract_signature":"train, values","evaluation_group":"w3-feature-preprocessing-fit-scope-robust-iqr-scaling","failed_approach":"The partial repair addresses the main convention but mishandles an edge case.","family":"w3-feature-preprocessing-fit-scope-robust-iqr-scaling-transform-state","id":"FA-100416","implementations":{"attempt":{"sha256":"9958e352c9af035c385c1e7c9fba2c3fa7259c5527a8f19ebcaebb3f4bff1e0a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(train); med=(v[(len(v)-1)//2]+v[len(v)//2])/2; q1=v[(len(v)-1)//4]; q3=v[(3*(len(v)-1))//4]; d=q3-q1; return [round((x-med)/(d+1),6) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('quartile spread',solve([0,2,4,6],[0,3,6]),[-1,0,1])\ncheck('heldout excluded',solve([0,2,4,6],[8]),[1.666667])\ncheck('even median',solve([0,2,4,6],[3]),[0])\ncheck('constant train',solve([N]*4,[N+2]),[0])\ncheck('singleton',solve([N],[N+1]),[0])\ncheck('negative values',solve([-6,-4,-2,0],[-4]),[-0.333333])\ncheck('empty values',solve([0,2,4,6],[]),[])\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":"7408220c5551da901476bc899a5dca1d603df750c669e77cfef17eaeebd4d25a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(train); med=(v[(len(v)-1)//2]+v[len(v)//2])/2; q1=v[(len(v)-1)//4]; q3=v[(3*(len(v)-1))//4]; d=q3-q1; return [round((x-med)/(d+1),6) if d else 0 for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('quartile spread',solve([0,2,4,6],[0,3,6]),[-1,0,1])\ncheck('heldout excluded',solve([0,2,4,6],[8]),[1.666667])\ncheck('even median',solve([0,2,4,6],[3]),[0])\ncheck('constant train',solve([N]*4,[N+2]),[0])\ncheck('singleton',solve([N],[N+1]),[0])\ncheck('negative values',solve([-6,-4,-2,0],[-4]),[-0.333333])\ncheck('empty values',solve([0,2,4,6],[]),[])\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 robust scalar scaler; quantiles use explicit linear interpolation over the sorted training values. 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-robust-iqr-scaling-transform-state","generated_at":"2026-09-30T16:48:35.362870+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":"48f09b99554f115ec752d9acf39341a4ed0bf63f3dafd65f33af51cec0fb87ae","title":"Median and interquartile scaling 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.974,"exit_code":1,"observations":[{"actual":[-0.6,0.0,0.6],"check":"quartile spread","expected":[-1,0,1],"passed":false},{"actual":[1.0],"check":"heldout excluded","expected":[1.666667],"passed":false},{"actual":[0.0],"check":"even median","expected":[0],"passed":true},{"actual":[2.0],"check":"constant train","expected":[0],"passed":false},{"actual":[1.0],"check":"singleton","expected":[0],"passed":false},{"actual":[-0.2],"check":"negative values","expected":[-0.333333],"passed":false},{"actual":[],"check":"empty values","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"quartile spread\", \"actual\": [-0.6, 0.0, 0.6], \"expected\": [-1, 0, 1], \"passed\": false}, {\"check\": \"heldout excluded\", \"actual\": [1.0], \"expected\": [1.666667], \"passed\": false}, {\"check\": \"even median\", \"actual\": [0.0], \"expected\": [0], \"passed\": true}, {\"check\": \"constant train\", \"actual\": [2.0], \"expected\": [0], \"passed\": false}, {\"check\": \"singleton\", \"actual\": [1.0], \"expected\": [0], \"passed\": false}, {\"check\": \"negative values\", \"actual\": [-0.2], \"expected\": [-0.333333], \"passed\": false}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.171,"exit_code":1,"observations":[{"actual":[-0.6,0.0,0.6],"check":"quartile spread","expected":[-1,0,1],"passed":false},{"actual":[1.0],"check":"heldout excluded","expected":[1.666667],"passed":false},{"actual":[0.0],"check":"even median","expected":[0],"passed":true},{"actual":[0],"check":"constant train","expected":[0],"passed":true},{"actual":[0],"check":"singleton","expected":[0],"passed":true},{"actual":[-0.2],"check":"negative values","expected":[-0.333333],"passed":false},{"actual":[],"check":"empty values","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"quartile spread\", \"actual\": [-0.6, 0.0, 0.6], \"expected\": [-1, 0, 1], \"passed\": false}, {\"check\": \"heldout excluded\", \"actual\": [1.0], \"expected\": [1.666667], \"passed\": false}, {\"check\": \"even median\", \"actual\": [0.0], \"expected\": [0], \"passed\": true}, {\"check\": \"constant train\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"negative values\", \"actual\": [-0.2], \"expected\": [-0.333333], \"passed\": false}, {\"check\": \"empty values\", \"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."}}