Skip to content

Preserve QRF feature order during prediction#195

Merged
MaxGhenis merged 1 commit into
mainfrom
codex/qrf-predict-feature-order-20260606
Jun 6, 2026
Merged

Preserve QRF feature order during prediction#195
MaxGhenis merged 1 commit into
mainfrom
codex/qrf-predict-feature-order-20260606

Conversation

@MaxGhenis

@MaxGhenis MaxGhenis commented Jun 6, 2026

Copy link
Copy Markdown
Contributor

Summary

  • store fitted feature-column order for QRF and random-forest classifier learners and realign prediction frames before calling sklearn
  • automatically keep numeric targets numeric when they become chained predictors inside zero-inflated per-regime base imputers
  • pass explicit not_numeric_categorical overrides through zero-inflated per-regime base imputers too
  • add focused regressions for reordered prediction frames, automatic chained numeric target preservation, and explicit override propagation

Tests

  • uv run ruff check microimpute/models/qrf.py microimpute/models/zero_inflated.py
  • uv run python -m pytest -q tests/test_models/test_zero_inflated.py::TestSequentialPredictorTyping tests/test_models/test_qrf.py::test_qrf_model_prediction_reorders_to_fitted_feature_order
  • uv run python -m pytest -q tests/test_models/test_zero_inflated.py
  • uv run python -m pytest -q tests/test_models/test_qrf.py

Notes

This fixes the Stage 05 MP/eCPS regime-aware resume failure where a later chained QRF prediction saw the same feature names in a different order than fit. It also prevents continuous prior imputed targets from being dummy-encoded inside nested zero-inflated base fits when they become predictors for later targets.

@vercel

vercel Bot commented Jun 6, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
microimpute-dashboard Ready Ready Preview, Comment Jun 6, 2026 9:43am

@MaxGhenis MaxGhenis force-pushed the codex/qrf-predict-feature-order-20260606 branch from f8a24cb to 90ed3df Compare June 6, 2026 09:42
@MaxGhenis MaxGhenis merged commit 4925c14 into main Jun 6, 2026
7 checks passed
@MaxGhenis MaxGhenis deleted the codex/qrf-predict-feature-order-20260606 branch June 6, 2026 09:51
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