{"abstract":"Median and interquartile scaling uses held-out rows while fitting.","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":"Filtering rows after computing the statistic still leaves held-out influence.","family":"w3-feature-preprocessing-fit-scope-robust-iqr-scaling-fit-leakage","id":"FA-100411","implementations":{"attempt":{"sha256":"482976293dd88fc1129d0c6e6f390bb8727a99b6c3a0fcdd297fe10775eba700","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    v=sorted(train+values); med=v[len(v)//2]; q1=v[len(v)//4]; q3=v[(3*len(v))//4]; d=q3-q1; return [round((x-med)/d,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"},"broken":{"sha256":"848c574b53203925ed31e2cbe001bcf48e18c8f3231eed84ec0a0ab2830327c6","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)//2]; q1=v[len(v)//4]; q3=v[(3*len(v))//4]; d=q3-q1; return [round((x-med)/d,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-fit-leakage","generated_at":"2026-09-30T16:48:35.362678+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":"7788683d913d74123967e1676c45aed229760a6cefa7e3a09ad72709e2ab70ad","title":"Median and interquartile scaling 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":27.425,"exit_code":1,"observations":[{"actual":[-0.5,0.0,0.5],"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.0],"check":"singleton","expected":[0],"passed":true},{"actual":[0.0],"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.5, 0.0, 0.5], \"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.0], \"expected\": [0], \"passed\": true}, {\"check\": \"negative values\", \"actual\": [0.0], \"expected\": [-0.333333], \"passed\": false}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.376,"exit_code":1,"observations":[{"actual":[-1.0,-0.25,0.5],"check":"quartile spread","expected":[-1,0,1],"passed":false},{"actual":[1.0],"check":"heldout excluded","expected":[1.666667],"passed":false},{"actual":[-0.25],"check":"even median","expected":[0],"passed":false},{"actual":[0],"check":"constant train","expected":[0],"passed":true},{"actual":[0],"check":"singleton","expected":[0],"passed":true},{"actual":[-0.5],"check":"negative values","expected":[-0.333333],"passed":false},{"actual":[],"check":"empty values","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"quartile spread\", \"actual\": [-1.0, -0.25, 0.5], \"expected\": [-1, 0, 1], \"passed\": false}, {\"check\": \"heldout excluded\", \"actual\": [1.0], \"expected\": [1.666667], \"passed\": false}, {\"check\": \"even median\", \"actual\": [-0.25], \"expected\": [0], \"passed\": false}, {\"check\": \"constant train\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"singleton\", \"actual\": [0], \"expected\": [0], \"passed\": true}, {\"check\": \"negative values\", \"actual\": [-0.5], \"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."}}