Skip to content

Allow nonnumeric regime-aware donor targets#245

Merged
MaxGhenis merged 1 commit into
mainfrom
codex/regime-aware-nonnumeric-regimes-20260606
Jun 6, 2026
Merged

Allow nonnumeric regime-aware donor targets#245
MaxGhenis merged 1 commit into
mainfrom
codex/regime-aware-nonnumeric-regimes-20260606

Conversation

@MaxGhenis
Copy link
Copy Markdown
Contributor

Summary

Fixes the next Stage 05 chained MicroImpute failure in the large PUF block. After #243 cleared duplicate DataFrame labels, the adapter crashed when it called get_regime() for every target. MicroImpute only exposes regimes for numeric targets; boolean/categorical targets like business_is_sstb are handled through its non-numeric bundle and should not require a numeric regime.

Changes:

  • record regimes from MicroImpute's numeric _regimes map instead of forcing get_regime() on every target
  • keep all fitted targets in _fitted_columns so generation can still emit non-numeric targets from the fitted result
  • add a regression with numeric self_employment_income plus boolean business_is_sstb

Verification

  • uv run ruff format src/microplex_us/pipelines/donor_imputers.py tests/pipelines/test_regime_aware_donor_imputer.py
  • uv run ruff check src/microplex_us/pipelines/donor_imputers.py tests/pipelines/test_regime_aware_donor_imputer.py
  • uv run --extra dev --extra policyengine python -m pytest -q tests/pipelines/test_regime_aware_donor_imputer.py -> 12 passed
  • uv run --extra dev --extra policyengine python -m pytest -q tests/pipelines/test_regime_aware_donor_imputer.py tests/test_variables.py tests/test_pe_source_impute_specs.py tests/test_pe_source_impute_engine.py tests/pipelines/test_zi_qrf_backend.py tests/pipelines/test_donor_imputer_negative_preservation.py tests/data_sources/test_scf_net_worth_components.py -k "imputer or regime_aware or columnwise or donor_imputation_block_specs or pe_source" -> 33 passed, 38 deselected

@MaxGhenis MaxGhenis merged commit 94d4941 into main Jun 6, 2026
5 checks passed
@MaxGhenis MaxGhenis deleted the codex/regime-aware-nonnumeric-regimes-20260606 branch June 6, 2026 08:45
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