C7: remove rlearner, relocate outcome-model factory into power_model - #133
Merged
Conversation
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>
Contributor
There was a problem hiding this comment.
Pull request overview
Removes the abandoned R-learner while preserving the outcome-model factory required by the power model.
Changes:
- Relocates
make_outcome_modeland 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.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Drop the rlearner package entirely, carrying forward only the shared piece power_model still needs.