FA-100416 / Feature preprocessing fit scope / Open access
Median and interquartile scaling applies fitted state incorrectly · case 01
Median and interquartile scaling applies fitted state incorrectly.
ROOT CAUSE
The transform applies a plausible but incorrect state convention.
THE FAILURE
The transform applies a plausible but incorrect state convention.
Unsuccessful approach: The partial repair addresses the main convention but mishandles an edge case.
Case 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.
Why this case matters
A small deterministic preprocessing contract makes the fit boundary and transform behavior directly inspectable.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(train, values):
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]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quartile spread',solve([0,2,4,6],[0,3,6]),[-1,0,1])
check('heldout excluded',solve([0,2,4,6],[8]),[1.666667])
check('even median',solve([0,2,4,6],[3]),[0])
check('constant train',solve([N]*4,[N+2]),[0])
check('singleton',solve([N],[N+1]),[0])
check('negative values',solve([-6,-4,-2,0],[-4]),[-0.333333])
check('empty values',solve([0,2,4,6],[]),[])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| quartile spread | [-0.6, 0.0, 0.6] | [-1, 0, 1] | Failed |
| heldout excluded | [1.0] | [1.666667] | Failed |
| even median | [0.0] | [0] | Passed |
| constant train | [0] | [0] | Passed |
| singleton | [0] | [0] | Passed |
| negative values | [-0.2] | [-0.333333] | Failed |
| empty values | [] | [] | Passed |
SHA-256 / 7408220c5551da901476bc899a5dca1d603df750c669e77cfef17eaeebd4d25a
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(train, values):
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]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('quartile spread',solve([0,2,4,6],[0,3,6]),[-1,0,1])
check('heldout excluded',solve([0,2,4,6],[8]),[1.666667])
check('even median',solve([0,2,4,6],[3]),[0])
check('constant train',solve([N]*4,[N+2]),[0])
check('singleton',solve([N],[N+1]),[0])
check('negative values',solve([-6,-4,-2,0],[-4]),[-0.333333])
check('empty values',solve([0,2,4,6],[]),[])
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
| Boundary fixture | Actual | Expected | Outcome |
|---|---|---|---|
| quartile spread | [-0.6, 0.0, 0.6] | [-1, 0, 1] | Failed |
| heldout excluded | [1.0] | [1.666667] | Failed |
| even median | [0.0] | [0] | Passed |
| constant train | [2.0] | [0] | Failed |
| singleton | [1.0] | [0] | Failed |
| negative values | [-0.2] | [-0.333333] | Failed |
| empty values | [] | [] | Passed |
SHA-256 / 9958e352c9af035c385c1e7c9fba2c3fa7259c5527a8f19ebcaebb3f4bff1e0a
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 7 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗Verification & scope
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.
Observations recorded using Python 3.12.14 at 2026-09-30T16:48:35.362870+00:00.
Case digest / 48f09b99554f115ec752d9acf39341a4ed0bf63f3dafd65f33af51cec0fb87ae