PolicyEngine / PolicyEngine/microcosm

Make zero-valued calibration targets intentionally nonzero-weighted

Open
#104 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
0
Forks
4
Avg merge
1d 3h
Merged PRs (30d)
94

Description

Zero-valued targets should still receive nonzero calibration loss weight.

Why:

  • A zero target can be meaningful, especially at small geography levels or sparse breakdowns.
  • If a state or local target is zero but the dataset estimates a positive value, the optimizer should see that error instead of silently ignoring the row.
  • This also makes target diagnostics easier to reason about when expanding the target surface.

Current context:

  • The current fiscal refresh loss weighting appears to use max(abs(target), 1.0) before applying sqrt target-value weights, so zero targets are not literally zero-weighted today.
  • We should make that behavior explicit and protected by tests/diagnostics, not incidental.

Acceptance criteria:

  • Zero-valued amount and count targets get a finite positive loss weight.
  • A regression test covers zero-valued targets under the active amount/count 50/50 target-weighting scheme.
  • The target-weight explorer or calibration diagnostics exposes the number of zero-valued targets and their assigned weight range.
  • Document the intended zero-target treatment near the loss-weighting code.

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start at the current fiscal refresh loss-weighting code and trace the active amount/count 50/50 target-weighting scheme. Then inspect the target-weight explorer or calibration diagnostics; done means zero-valued amount and count targets have finite positive weights, regression coverage exists, zero-target counts and weight ranges are exposed, and the intended treatment is documented nearby.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
data
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
55/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.