Skip to content

Chain MicroImpute donor blocks#240

Merged
MaxGhenis merged 1 commit into
mainfrom
codex/chained-microimpute-donor-20260606
Jun 6, 2026
Merged

Chain MicroImpute donor blocks#240
MaxGhenis merged 1 commit into
mainfrom
codex/chained-microimpute-donor-20260606

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

  • update the PolicyEngine extra to published microimpute 3.1.0, which contains sequential ZeroInflatedImputer support
  • fit one regime-aware ZeroInflatedImputer per compatible donor block instead of one independent wrapper per target
  • group compatible donor targets into chained blocks while keeping the dividend composition block and entity policies intact
  • add a regression proving the second target in a Microplex block uses the first target as a microimpute predictor

Why

The prior MP replacement build called microimpute one target at a time, so prior imputations were never available as predictors for later income/tax leaves. This PR makes that failure mode test-visible: multi-target regime-aware fits must share one fitted microimpute result, and target 2 must store target 1 in its predictor list.

Verification

  • env -u UV_FROZEN uv run --python 3.13 --extra dev --extra policyengine ruff check src/microplex_us/pipelines/donor_imputers.py src/microplex_us/variables.py tests/pipelines/test_regime_aware_donor_imputer.py tests/test_variables.py
  • env -u UV_FROZEN uv run --python 3.13 --extra dev --extra policyengine pytest -q tests/pipelines/test_regime_aware_donor_imputer.py tests/test_variables.py
  • env -u UV_FROZEN uv run --python 3.13 --extra dev --extra policyengine pytest -q tests/test_pe_source_impute_specs.py tests/test_pe_source_impute_engine.py
  • env -u UV_FROZEN uv run --python 3.13 --extra dev --extra policyengine pytest -q tests/pipelines/test_zi_qrf_backend.py
  • env -u UV_FROZEN uv run --python 3.13 --extra dev --extra policyengine pytest -q tests/pipelines/test_donor_imputer_negative_preservation.py tests/data_sources/test_scf_net_worth_components.py -k "imputer or regime_aware or columnwise"
  • installed-version smoke confirms microimpute 3.1.0 and ZeroInflatedImputer(..., sequential=True)

@MaxGhenis MaxGhenis merged commit fc26012 into main Jun 6, 2026
5 checks passed
@MaxGhenis MaxGhenis deleted the codex/chained-microimpute-donor-20260606 branch June 6, 2026 07:02
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