Child slot labels should be youngest-first, not oldest-first
I maintainer di solito rispondono entro 1 giorno
Nessuno ha ancora preso questa issue.
Valutazione
- Difficoltà
- 4/5
- Tempo stimato
- 3-5 giorni
- Idoneità per principianti
- 55/100
Direzione di ricerca
Inizia in scenarios.py:1160-1163 per il percorso US e in scenarios.py:1337-1357 per il percorso UK, quindi esamina gli scenari generati e lo snapshot congelato del paper alla ricerca di riferimenti ai child-slot. Modifica l’ordine in modo che child1 sia il più giovane, rigenera gli artefatti interessati e aggiorna gli output del modello, le note di audit e le annotazioni dei casi; il lavoro è completato quando entrambi i percorsi e i riferimenti a valle usano coerentemente la nuova convenzione.
Scritto dal modello di indicizzazione a partire dal testo della issue.
Descrizione
Problem
scenarios.py:1160-1163 (US) and the analogous UK code at scenarios.py:1337-1357 sort household members by descending age before assigning child1, child2, ... labels:
household.sort_values(
by=["is_tax_unit_head", "is_tax_unit_spouse", "age", "person_id"],
ascending=[False, False, False, True], # age=False → DESCENDING
)
So child1 is the oldest child in the household, child2 the next oldest, etc. This inverts the natural reading for benefit programs that target young children — WIC (age < 5), Head Start (3–4), Early Head Start (under 3), Medicaid/CHIP eligibility (varies by age/income), school-meal eligibility.
Concrete evidence
Across the 10 US multi-child benchmark scenarios:
| Scenario | child1 age | child2 age | child3 age | ... |
|---|---|---|---|---|
| 008 | 4 | 0 | – | – |
| 030 | 16 | 14 | 11 | – |
| 053 | 7 | 5 | 0 | – |
| 055 | 17 | 14 | 12 | 10, 5, 1 |
| 061 | 7 | 3 | – | – |
| 089 | 7 | 3 | – | – |
WIC eligibility (age < 5) by child slot in the sample:
child1_wic_eligible: 1 case (only scenario 008)child2_wic_eligible: 3 cases (008, 061, 089)child3_wic_eligible: 1 case (053)child6_wic_eligible: 1 case (055)
The household-impact weight share follows the same shape — child2_wic_eligible weight (0.0017) is ~2× child1_wic_eligible (0.0009). That's the inverse of what users will expect when reading "Child 1 WIC eligibility" in the prompt or the program breakdown table.
Why this matters
- Prompt readability: a reader expects "Child 1" to be the household's most prominent young-child case for these programs, not the oldest sibling who's usually outside the eligibility age band.
- Person-level slot weights: programs that key on young children (WIC, EHS) get most of their weight on
child2/child3rather thanchild1, distorting the program breakdown table. - Failure-mode attribution: when a model misses WIC eligibility on the youngest child, the failure currently surfaces under
child2_wic_eligibleetc., not under the "primary" label.
Proposed fix
Switch the age sort to ascending — youngest child first. After the head/spouse rows, append children oldest-last so child1 is the youngest. Same in the UK path.
- ascending=[False, False, False, True],
+ ascending=[False, False, True, True],
This is a content change that renames many prompt-visible labels (child1_* → was-childN_*), so it will:
- Invalidate the frozen paper snapshot's reproducibility against re-generated scenarios
- Shift household-impact weights between
childNslots - Require updating model outputs that referenced specific child slots by index (audit notes, case annotations)
If the frozen paper snapshot needs to stay byte-identical, this should land alongside a new snapshot date and a paper note that the convention changed.
Out of scope
- Headline metric / weighting from the population — separate issue (#49).
- Adult slot ordering (
adult1,adult2) — currently spouse comes second byis_tax_unit_spouseflag; that's a different sort and isn't affected by this change.
- Lingua principale
- Python
- Stelle
- 2
- Fork
- 3
- Merge medio
- 11h 11m
- PR unite (30g)
- 22
Preparare l'ambiente
- Nessun Dockerfile né file Docker Compose
- Nessun modello di pull request
- Leggi la guida per i contributori
Come iniziare
- Leggi tutta la issue e poi la guida ai contributi del progetto.
- Commenta sulla issue per dire che te ne occupi tu — evita che due persone facciano lo stesso lavoro.
- Fai un fork del repository e lavora su un branch.
- Apri una pull request che faccia riferimento al numero della issue.
Altre issue di PolicyEngine/policybench
-
v2 prompt and data: program-specific disability facts, integer inputs, and the take-up boundaryAperta
Difficoltà 5/5 Più di una settimana Idoneità per principianti 38/100
PolicyEngine/policybench#165 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 35/100
PolicyEngine/policybench#145 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 52/100
PolicyEngine/policybench#140 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 5/5 Più di una settimana Idoneità per principianti 25/100
PolicyEngine/policybench#139 · 2 commenti ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 3/5 1-2 giorni Idoneità per principianti 68/100
PolicyEngine/policybench#129 ·
I maintainer di solito rispondono entro 1 giorno
Tutte le issue di PolicyEngine/policybench
Issue simili
-
Agentic
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 82/100
Imbad0202/academic-research-skills#979 ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
reflex-dev/reflex#7561 · 1 commento ·
I maintainer di solito rispondono entro 1 giorno
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 72/100
-
Difficoltà 2/5 1-3 ore Idoneità per principianti 62/100
prometheus-community/ansible#906 · 2 commenti ·