FA-98036 / Training label alignment / Open access
Balanced example weights divide by total examples instead of class frequency · case 01
Balanced example weights divide by total examples instead of class frequency.
ROOT CAUSE
Every row receives the same inverse total weight regardless of its class count.
THE FAILURE
Every row receives the same inverse total weight regardless of its class count.
Unsuccessful approach: Using only inverse class frequency gives a different total scale and fails the declared normalization.
Case contract
For labels, return M/(K*count(label)) per row, where M is row count and K the number of observed classes; empty input returns empty.
Why this case matters
A small deterministic training-data operation makes label ownership and ordering explicit.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(labels):
return [1/len(labels) for _ in labels] if labels else []
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('imbalanced classes',solve(['a','a','b']),[0.75,0.75,1.5])
check('balanced classes',solve(['a','b']),[1.0,1.0])
check('empty',solve([]),[])
check('single class',solve(['x']*N),[1.0]*N)
check('three classes',solve(['c','a','b']),[1.0,1.0,1.0])
check('one rare class',solve(['a','a','a','b']),[2/3,2/3,2/3,2.0])
check('order preserved',solve(['b','a','b']),[0.75,1.5,0.75])
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 |
|---|---|---|---|
| imbalanced classes | [0.3333333333333333, 0.3333333333333333, 0.3333333333333333] | [0.75, 0.75, 1.5] | Failed |
| balanced classes | [0.5, 0.5] | [1.0, 1.0] | Failed |
| empty | [] | [] | Passed |
| single class | [1.0] | [1.0] | Passed |
| three classes | [0.3333333333333333, 0.3333333333333333, 0.3333333333333333] | [1.0, 1.0, 1.0] | Failed |
| one rare class | [0.25, 0.25, 0.25, 0.25] | [0.6666666666666666, 0.6666666666666666, 0.6666666666666666, 2.0] | Failed |
| order preserved | [0.3333333333333333, 0.3333333333333333, 0.3333333333333333] | [0.75, 1.5, 0.75] | Failed |
SHA-256 / 32c6ad43554adb38124edbc933515fba2ec6dc88dc6ca9427e65a667249d6f15
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(labels):
from collections import Counter
c=Counter(labels)
return [1/c[y] for y in labels]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('imbalanced classes',solve(['a','a','b']),[0.75,0.75,1.5])
check('balanced classes',solve(['a','b']),[1.0,1.0])
check('empty',solve([]),[])
check('single class',solve(['x']*N),[1.0]*N)
check('three classes',solve(['c','a','b']),[1.0,1.0,1.0])
check('one rare class',solve(['a','a','a','b']),[2/3,2/3,2/3,2.0])
check('order preserved',solve(['b','a','b']),[0.75,1.5,0.75])
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 |
|---|---|---|---|
| imbalanced classes | [0.5, 0.5, 1.0] | [0.75, 0.75, 1.5] | Failed |
| balanced classes | [1.0, 1.0] | [1.0, 1.0] | Passed |
| empty | [] | [] | Passed |
| single class | [1.0] | [1.0] | Passed |
| three classes | [1.0, 1.0, 1.0] | [1.0, 1.0, 1.0] | Passed |
| one rare class | [0.3333333333333333, 0.3333333333333333, 0.3333333333333333, 1.0] | [0.6666666666666666, 0.6666666666666666, 0.6666666666666666, 2.0] | Failed |
| order preserved | [0.5, 1.0, 0.5] | [0.75, 1.5, 0.75] | Failed |
SHA-256 / 96c9e86894413036ac038a2de5db1b357ee53c1a8823c024fe0f1b2bef935879
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
Class labels are hashable; floating outputs are exact simple ratios in these fixtures. 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:08.407499+00:00.
Case digest / 440ee96410cb7cdf8d93d272f53dcb15b0f2f86a82fc43e790d58fb7e53d9147