Skip to content

Weight US fiscal calibration loss by target value#89

Merged
MaxGhenis merged 1 commit into
mainfrom
codex/weighted-calibration-loss-20260617
Jun 17, 2026
Merged

Weight US fiscal calibration loss by target value#89
MaxGhenis merged 1 commit into
mainfrom
codex/weighted-calibration-loss-20260617

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

  • add optional target row weights to the calibration relative-error objective
  • keep unweighted calibration as the default API behavior
  • make the US fiscal refresh builder weight target rows by normalized absolute target value, so national dollar totals are not one vote among thousands of rows
  • record the fiscal refresh weighting strategy in calibration diagnostics build metadata

Why

The broken release exposed that an unweighted row average is not a sufficient solve priority for a target surface dominated by many state-level rows. Hard gates now prevent critical misses from certifying; this PR changes the optimizer objective so large national fiscal targets receive proportionate pull during the solve.

Validation

  • PYTHONPATH=packages/populace-calibrate/src:packages/populace-frame/src uv run --python 3.13 --with pytest --with numpy --with pandas --with torch --with scipy python -m pytest packages/populace-calibrate/tests/test_solve.py -q
  • PYTHONPATH=packages/populace-build/src:packages/populace-calibrate/src:packages/populace-frame/src:packages/populace-fit/src:packages/populace-data/src uv run --python 3.13 --with pytest --with numpy --with pandas --with packaging --with h5py --with torch --with scipy python -m pytest packages/populace-build/tests/test_gates.py packages/populace-build/tests/test_us_fiscal_refresh_builder.py -q
  • uv run --python 3.13 ruff check packages/populace-calibrate/src/populace/calibrate/solve.py packages/populace-calibrate/tests/test_solve.py packages/populace-build/tests/test_gates.py tools/build_us_fiscal_refresh_release.py packages/populace-build/tests/test_us_fiscal_refresh_builder.py
  • uv run --python 3.13 ruff format --check packages/populace-calibrate/src/populace/calibrate/solve.py packages/populace-calibrate/tests/test_solve.py packages/populace-build/tests/test_gates.py tools/build_us_fiscal_refresh_release.py packages/populace-build/tests/test_us_fiscal_refresh_builder.py && git diff --check

@MaxGhenis MaxGhenis force-pushed the codex/weighted-calibration-loss-20260617 branch from a0de159 to adb25bd Compare June 17, 2026 11:34
@MaxGhenis MaxGhenis force-pushed the codex/weighted-calibration-loss-20260617 branch from adb25bd to cb6a206 Compare June 17, 2026 11:38
@MaxGhenis MaxGhenis merged commit a3d3d8a into main Jun 17, 2026
4 checks passed
@MaxGhenis MaxGhenis deleted the codex/weighted-calibration-loss-20260617 branch June 17, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant