Skip to content

Add propensity clipping diagnostics to DRTester - #1063

Open
leninworld wants to merge 1 commit into
py-why:mainfrom
leninworld:feat-propensity-clipping-diagnostics-issue-1054
Open

leninworld wants to merge 1 commit into
py-why:mainfrom
leninworld:feat-propensity-clipping-diagnostics-issue-1054

Conversation

@leninworld

@leninworld leninworld commented Sep 19, 2026 •

Copy link
Copy Markdown

This PR fixes issue #1054.

Summary

  • make the lower propensity clipping threshold configurable in calculate_dr_outcomes and DRTester
  • report structured train/validation clipping diagnostics by observed treatment arm
  • warn only when clipping changes a doubly robust denominator, while preserving all-row overlap counts
  • validate non-finite inputs, incompatible shapes, and missing control treatment 0

Closes #1054.

Validation

  • python -m pytest econml/tests/test_validate_utils.py econml/tests/test_drtester.py -q -o addopts='' -p no:cacheprovider — 11 passed, 6 subtests passed
  • Ruff lint on all changed files — passed
  • Python compilation and git diff --check — passed
  • Existing real-model DRTester tests exercise binary, multi-treatment, train/validation, and dataframe paths

Validation evidence

EconML Stage 3 validation

Compatibility and scope

The default threshold remains 0.01, and default arithmetic is unchanged when no clipping occurs. The new warnings distinguish clipping that affects an assigned treatment denominator from low propensity values on unassigned rows.

This PR intentionally does not implement trimming because trimming changes the analyzed sample and can change the estimand. Upper clipping and propensity calibration are also out of scope.

The validation now raises explicit ValueError exceptions for non-finite inputs and for data without control treatment 0 instead of allowing invalid doubly robust output.

Signed-off-by: lenin <lenin.world@gmail.com>
@leninworld
leninworld force-pushed the feat-propensity-clipping-diagnostics-issue-1054 branch from 7696d40 to ac02f06 Compare September 20, 2026 07:17

This branch has not been deployed

No deployments
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.

Suggestion: Warn when clipping propensity scores to improve transparency

1 participant