Skip to content

C7: remove rlearner, relocate outcome-model factory into power_model - #133

Merged
aclerc merged 1 commit into
v1from
v1-remove-rlearner
Aug 28, 2026
Merged

C7: remove rlearner, relocate outcome-model factory into power_model#133
aclerc merged 1 commit into
v1from
v1-remove-rlearner

Conversation

@aclerc

@aclerc aclerc commented Aug 28, 2026

Copy link
Copy Markdown
Contributor

Drop the rlearner package entirely, carrying forward only the shared piece power_model still needs.

  • Relocate make_outcome_model (+ its _COMMON params and lazy lightgbm import) verbatim from rlearner/nuisance.py into power_model/fitting.py; repoint power_model/method.py and inspect_era5_matching_importance.py. Estimator construction is byte-identical, so power_model behaviour is unchanged.
  • Carry over the factory's direct unit test into test_power_model_fitting.py (TestMakeOutcomeModel) so relocating it does not drop its unit coverage.
  • Delete the rlearner package, its seven tests, and the rlearner-only inspect_prepost_feature_ablation.py. Rename the "rlearner" fixture labels in test_plots.py (they were plain strings, no import).
  • Drop the now-stale rlearner references in era5_sync.py and method.py docstrings.

Drop the rlearner package entirely, carrying forward only the shared piece
power_model still needs.

- Relocate make_outcome_model (+ its _COMMON params and lazy lightgbm import)
  verbatim from rlearner/nuisance.py into power_model/fitting.py; repoint
  power_model/method.py and inspect_era5_matching_importance.py. Estimator
  construction is byte-identical, so power_model behaviour is unchanged.
- Carry over the factory's direct unit test into test_power_model_fitting.py
  (TestMakeOutcomeModel) so relocating it does not drop its unit coverage.
- Delete the rlearner package, its seven tests, and the rlearner-only
  inspect_prepost_feature_ablation.py. Rename the "rlearner" fixture labels in
  test_plots.py (they were plain strings, no import).
- Drop the now-stale rlearner references in era5_sync.py and method.py docstrings.

Acceptance: poe all-fast green; power_model reads UNCHANGED against both
committed benchmarks (study_toggle_methods_compare max delta 0.06 pp;
study_power_model_compare 0 material moves), i.e. identical to within LightGBM's
same-machine noise floor.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Removes the abandoned R-learner while preserving the outcome-model factory required by the power model.

Changes:

  • Relocates make_outcome_model and updates callers and tests.
  • Deletes the R-learner package, tests, and inspection script.
  • Cleans remaining active references and plot fixtures.

Reviewed changes

Copilot reviewed 23 out of 23 changed files in this pull request and generated no comments.

Show a summary per file
File Description
benchmarking/baselines/power_model/fitting.py Hosts the relocated LightGBM factory.
benchmarking/baselines/power_model/method.py Imports the relocated factory.
benchmarking/baselines/inspect_era5_matching_importance.py Uses the relocated factory.
benchmarking/baselines/era5_sync.py Removes obsolete R-learner history.
benchmarking/baselines/inspect_prepost_feature_ablation.py Removes the R-learner-only tool.
benchmarking/baselines/rlearner/__init__.py Removes the package export.
benchmarking/baselines/rlearner/method.py Removes the estimator integration.
benchmarking/baselines/rlearner/rlearner.py Removes the cross-fit implementation.
benchmarking/baselines/rlearner/nuisance.py Removes obsolete model factories.
benchmarking/baselines/rlearner/features.py Removes R-learner feature construction.
benchmarking/baselines/rlearner/filtering.py Removes the compatibility re-export.
benchmarking/baselines/rlearner/era5_sync.py Removes the compatibility re-export.
benchmarking/baselines/rlearner/diagnostics.py Removes R-learner diagnostics.
tests/benchmarking/baselines/test_power_model_fitting.py Preserves factory unit coverage.
tests/benchmarking/harness/test_plots.py Replaces R-learner fixture labels.
tests/benchmarking/baselines/test_rlearner_method.py Removes method tests.
tests/benchmarking/baselines/test_rlearner_filtering.py Removes filtering tests.
tests/benchmarking/baselines/test_rlearner_features.py Removes feature tests.
tests/benchmarking/baselines/test_rlearner_era5_sync.py Removes ERA5 synchronization tests.
tests/benchmarking/baselines/test_rlearner_end_to_end.py Removes skipped end-to-end tests.
tests/benchmarking/baselines/test_rlearner_core.py Removes core algorithm tests.
tests/benchmarking/baselines/test_rlearner_bias_guard.py Removes bias-guard tests.
docs/v1/issues_campaigns.md Records C7 completion and validation.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@aclerc
aclerc merged commit 293d69e into v1 Aug 28, 2026
1 check passed
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.

2 participants