{"abstract":"Category vocabulary encoding uses held-out rows while fitting.","category":"Feature preprocessing fit scope","checks":7,"contract":"Fit sorted unique string classes from train and return their zero-based positions for transform values; any unseen string receives sentinel -1.","contract_signature":"train, values","evaluation_group":"w3-feature-preprocessing-fit-scope-category-vocabulary","failed_approach":"Filtering rows after computing the statistic still leaves held-out influence.","family":"w3-feature-preprocessing-fit-scope-category-vocabulary-fit-leakage","id":"FA-100371","implementations":{"attempt":{"sha256":"948aba7cf5d5bb109518236d4d1799ac68b75a8e15ea25d97529399a08c0314d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    vocab=sorted(set(train+values)); return [vocab.index(x) for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='c'+str(N); train=['b',a]; vals=[a,'b','u'+str(N),'']; check('lexical train ids',solve(train,vals),[1,0,-1,-1])\ncheck('heldout category unknown',solve(['a','c'],['b']),[-1])\ncheck('repeat',solve(['z','a','z'],['z','z']),[1,1])\ncheck('empty values',solve(['a'],[]),[])\ncheck('empty fit',solve([],['a']),[-1])\ncheck('empty string unknown',solve(['a'],['']),[-1])\ncheck('known singleton',solve(['x'],['x']),[0])\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":"710c7c3fa13ea05b33703870f96268860bd32012eedc9aeab85002e51d34bc4e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(train, values):\n    vocab=sorted(set(train+values)); return [vocab.index(x) if x in vocab else -1 for x in values]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\na='c'+str(N); train=['b',a]; vals=[a,'b','u'+str(N),'']; check('lexical train ids',solve(train,vals),[1,0,-1,-1])\ncheck('heldout category unknown',solve(['a','c'],['b']),[-1])\ncheck('repeat',solve(['z','a','z'],['z','z']),[1,1])\ncheck('empty values',solve(['a'],[]),[])\ncheck('empty fit',solve([],['a']),[-1])\ncheck('empty string unknown',solve(['a'],['']),[-1])\ncheck('known singleton',solve(['x'],['x']),[0])\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 categorical ordinal encoding with deterministic lexical order and a single unknown sentinel. 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-category-vocabulary-fit-leakage","generated_at":"2026-09-30T16:48:34.921039+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":"996095f1da714491522c958419c5fdd6ad53c2981118b3ad705733d2a5724da0","title":"Category vocabulary encoding 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.4,"exit_code":1,"observations":[{"actual":[2,1,3,0],"check":"lexical train ids","expected":[1,0,-1,-1],"passed":false},{"actual":[1],"check":"heldout category unknown","expected":[-1],"passed":false},{"actual":[1,1],"check":"repeat","expected":[1,1],"passed":true},{"actual":[],"check":"empty values","expected":[],"passed":true},{"actual":[0],"check":"empty fit","expected":[-1],"passed":false},{"actual":[0],"check":"empty string unknown","expected":[-1],"passed":false},{"actual":[0],"check":"known singleton","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lexical train ids\", \"actual\": [2, 1, 3, 0], \"expected\": [1, 0, -1, -1], \"passed\": false}, {\"check\": \"heldout category unknown\", \"actual\": [1], \"expected\": [-1], \"passed\": false}, {\"check\": \"repeat\", \"actual\": [1, 1], \"expected\": [1, 1], \"passed\": true}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty fit\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"empty string unknown\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"known singleton\", \"actual\": [0], \"expected\": [0], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":28.239,"exit_code":1,"observations":[{"actual":[2,1,3,0],"check":"lexical train ids","expected":[1,0,-1,-1],"passed":false},{"actual":[1],"check":"heldout category unknown","expected":[-1],"passed":false},{"actual":[1,1],"check":"repeat","expected":[1,1],"passed":true},{"actual":[],"check":"empty values","expected":[],"passed":true},{"actual":[0],"check":"empty fit","expected":[-1],"passed":false},{"actual":[0],"check":"empty string unknown","expected":[-1],"passed":false},{"actual":[0],"check":"known singleton","expected":[0],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"lexical train ids\", \"actual\": [2, 1, 3, 0], \"expected\": [1, 0, -1, -1], \"passed\": false}, {\"check\": \"heldout category unknown\", \"actual\": [1], \"expected\": [-1], \"passed\": false}, {\"check\": \"repeat\", \"actual\": [1, 1], \"expected\": [1, 1], \"passed\": true}, {\"check\": \"empty values\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"empty fit\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"empty string unknown\", \"actual\": [0], \"expected\": [-1], \"passed\": false}, {\"check\": \"known singleton\", \"actual\": [0], \"expected\": [0], \"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."}}