Skip to content

Weight fiscal calibration loss by target value basis#97

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

Weight fiscal calibration loss by target value basis#97
MaxGhenis merged 1 commit into
mainfrom
codex/loss-value-basis-20260617

Conversation

@MaxGhenis

Copy link
Copy Markdown
Contributor

Summary

  • remove initial-estimate dependence from default target loss scales; default scale is now max(abs(target), 1)
  • weight US fiscal refresh target rows by target value within structured measure bases (amount, return_count, person_count)
  • keep semantic critical-national-total boosts and state-row downweighting, normalized to mean row weight 1
  • add regressions for return/claim count classification and for ignoring initial estimates in default scales

Objective

For compiled target row i and weights w:

estimate_i(w) = A_i @ w
scale_i = max(abs(target_i), 1)
row_weight_i = normalize_to_mean_1(value_weight_i * semantic_i * geography_i)
value_weight_i = max(abs(target_i), 1) / mean_j_in_same_basis(max(abs(target_j), 1))
loss(w) = sum_i row_weight_i * min(abs(estimate_i(w) - target_i) / scale_i, 10) / sum_i row_weight_i

Initial estimates are diagnostics only; they no longer set permanent target scale.

Validation

  • uv run --frozen --all-packages --python 3.13 python -m pytest -q
  • uv run --frozen --all-packages --python 3.13 ruff check packages/populace-calibrate/src/populace/calibrate/solve.py packages/populace-calibrate/tests/test_solve.py tools/build_us_fiscal_refresh_release.py packages/populace-build/tests/test_us_fiscal_refresh_builder.py
  • git diff --check
  • /cycle read-only subagent review: first pass found SOI returns/claims basis bug; fixed. Second pass found no actionable issues.

External Review

Requested ChatGPT Pro review via in-app browser, but chatgpt.com is currently blocked behind Cloudflare human verification. Pending user confirmation to solve that verification.

@MaxGhenis MaxGhenis force-pushed the codex/loss-value-basis-20260617 branch from cef4262 to b5d3b57 Compare June 17, 2026 16:15
@MaxGhenis MaxGhenis merged commit 059b2ec into main Jun 17, 2026
4 checks passed
@MaxGhenis MaxGhenis deleted the codex/loss-value-basis-20260617 branch June 17, 2026 16:17
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