FAILURE MAP
← Case archive

FA-100426 / Feature preprocessing fit scope / Open access

Quantile bin assignment applies fitted state incorrectly · case 01

Quantile bin assignment applies fitted state incorrectly.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

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

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); 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 fixtureActualExpectedOutcome
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

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 fixtureActualExpectedOutcome
three equal-width ranks[0, 1, 2][0, 0, 2]Failed
nondivisible rank boundary[1][1]Passed
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[1, 1][0, 1]Failed
one bin[0, 0][0, 0]Passed
empty values[][]Passed
upper extreme[1][0]Failed

SHA-256 / d4b4dc1c608111491e8ab296083bef07a0fe852f11fb210ead1032b67d18e76c

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.362759+00:00.

Case digest / 5d296fbcf867f0fadd3142c3490bf9d636903450fa53b3ab9a838aec33a2d535