Conversation
Signed-off-by: Shenbo Xu <xushenbo@mit.edu> Signed-off-by: Shenbo Xu <27264836+xushenbo@users.noreply.github.com>
xushenbo
force-pushed
the
censor-hte-pr
branch
from
September 16, 2026 12:28
ed5b399 to
881baae
Compare
- Remove unused locals and imports flagged by ruff 0.12.2 - Add missing `warn` import in SurvivalForest OOB fallback (was a NameError) - Wrap lines over 120 chars, fix D205 docstring summaries - Notebooks: import from the public econml.metalearners / econml.grf API, drop importlib.reload scaffolding, wrap long lines Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Shenbo Xu <27264836+xushenbo@users.noreply.github.com>
xushenbo
force-pushed
the
censor-hte-pr
branch
from
September 16, 2026 12:29
881baae to
9a98dbe
Compare
- Re-export the original TLearner/SLearner/XLearner from econml.metalearners; the cross-fitted CUT learners are now CrossFitTLearner/CrossFitSLearner/ CrossFitXLearner (tests, docs and notebooks updated) - Import scikit-survival lazily via _LazyModule so econml.metalearners and econml.censor import without it; declare it as the `censor` extra (and in `all`) and install it in the CI test and notebook jobs - Skip the censored-outcome tests when scikit-survival is absent - Document SurvivalForest/survival_forest and the separable-effect learners in the API reference Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com> Signed-off-by: Shenbo Xu <27264836+xushenbo@users.noreply.github.com>
Author
|
hey @kbattocchi , could you please review this PR when you get a chance? I'd really appreciate it! The branch went from failing lint, out of date, breaking the existing API, and unimportable without an undeclared dependency — to clean, rebased, backward compatible, and ready for review. |
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.
Add survival and competing-risk HTE learners
Summary
This PR adds heterogeneous treatment effect support for censored outcomes to EconML, including both survival and competing-risk settings.
The implementation follows the censoring-unbiased transformation (CUT) framework, which converts censored time-to-event outcomes into continuous transformed outcomes so that HTE learners for continuous outcomes can be applied consistently in censored settings.
Motivation
This contribution is based on my work on orthogonal statistical learning for survival and competing-risk outcomes, including the CUT framework developed in:
The goal is to extend EconML's reach beyond continuous and binary outcomes to time-to-event settings that are common in biostatistics and medical research.
What this PR adds
Censored-outcome functionality
econml.censorLearners
econml.metalearnersForest-based methods
CausalSurvivalForestSurvivalForestgrf-masterDocumentation and examples
Validation
I ran the following checks:
python3 -m unittest econml.tests.test_censor.test_crossfit_meta -vpython3 -m unittest econml.tests.test_censor.test_simulation -qpython3 -m unittest econml.tests.test_censor.test_survival_meta econml.tests.test_censor.test_competing_meta -qLC_ALL=C LANG=C PYTHONPATH=/tmp/econml-docs-env python3 -m sphinx -W -E -a -b html doc build/sphinx/htmlNotes