FA-100421 / Feature preprocessing fit scope / Open access
Quantile bin assignment uses held-out rows while fitting · case 01
Quantile bin assignment uses held-out rows while fitting.
ROOT CAUSE
Fitting reads values outside the designated training rows.
THE FAILURE
Fitting reads values outside the designated training rows.
Unsuccessful approach: Filtering rows after computing the statistic still leaves held-out influence.
Case contract
Train is nonempty, bins is positive. Select empirical cut values at floor(i*n/bins), capped to the final training index. Count strict greater-than cut comparisons, so equality stays in the lower bin.
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, bins):
v=sorted(train+values); edges=[v[(i*len(v))//bins] for i in range(1,bins)]; return [sum(x>e for e in edges) for x in values]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('three equal-width ranks',solve([0,1,2,3,4,5],[0,2,5],3),[0,0,2])
check('nondivisible rank boundary',solve([0,1,2,3,4],[3],2),[1])
check('heldout cannot set cuts',solve([0,10,20],[8,12,18],3),[0,1,1])
check('boundary equality stays lower',solve([0,2,4,6],[2,3,4],2),[0,0,0])
check('repeated training values',solve([1,1,1,9],[1,9],2),[0,1])
check('one bin',solve([0,2,4],[N,100],1),[0,0])
check('empty values',solve([0,2],[],2),[])
check('upper extreme',solve([0,10],[10],2),[0])
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 |
|---|---|---|---|
| three equal-width ranks | [0, 0, 2] | [0, 0, 2] | Passed |
| nondivisible rank boundary | [0] | [1] | Failed |
| heldout cannot set cuts | [0, 1, 1] | [0, 1, 1] | Passed |
| boundary equality stays lower | [0, 0, 1] | [0, 0, 0] | Failed |
| repeated training values | [0, 1] | [0, 1] | Passed |
| one bin | [0, 0] | [0, 0] | Passed |
| empty values | [] | [] | Passed |
| upper extreme | [0] | [0] | Passed |
SHA-256 / 0a09914c76a9d1a71ca5b16c488d1d59d3e8980eb16305a925ab7e58f0bc9c23
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(train, values, bins):
v=sorted(train); edges=[v[min(len(v)-1,((i*len(v)+bins-1)//bins))] for i in range(1,bins)]; return [sum(x>e for e in edges) for x in values]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('three equal-width ranks',solve([0,1,2,3,4,5],[0,2,5],3),[0,0,2])
check('nondivisible rank boundary',solve([0,1,2,3,4],[3],2),[1])
check('heldout cannot set cuts',solve([0,10,20],[8,12,18],3),[0,1,1])
check('boundary equality stays lower',solve([0,2,4,6],[2,3,4],2),[0,0,0])
check('repeated training values',solve([1,1,1,9],[1,9],2),[0,1])
check('one bin',solve([0,2,4],[N,100],1),[0,0])
check('empty values',solve([0,2],[],2),[])
check('upper extreme',solve([0,10],[10],2),[0])
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 |
|---|---|---|---|
| three equal-width ranks | [0, 0, 2] | [0, 0, 2] | Passed |
| nondivisible rank boundary | [0] | [1] | Failed |
| heldout cannot set cuts | [0, 1, 1] | [0, 1, 1] | Passed |
| boundary equality stays lower | [0, 0, 0] | [0, 0, 0] | Passed |
| repeated training values | [0, 1] | [0, 1] | Passed |
| one bin | [0, 0] | [0, 0] | Passed |
| empty values | [] | [] | Passed |
| upper extreme | [0] | [0] | Passed |
SHA-256 / ec3fe8b5402f086c7e2e736a2dc22cd2783698dcd846f6bad081e9a2ae46ce1c
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 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 empirical rank binning with duplicate cuts permitted and equality assigned to the lower bin. 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.362781+00:00.
Case digest / 59c3b5ce29a0878e5dd40cbfe3b54b24135327f015aca553da07d0d409140a91