-
Notifications
You must be signed in to change notification settings - Fork 790
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
resolves #796 remove dep on pygam, use IsotonicRegression #803
base: master
Are you sure you want to change the base?
Conversation
Thanks for the quick turnaround, @ras44. The test is failing, I guess, because the new calibrated propensity contains 0 or 1. Propensity scores, or treatment probabilities, should be within (0, 1), excluding 0 or 1, and binomial-like outputs are not ideal. |
I'm reposting my message from Slack. ICYMI: In your example notebook, treatment is supposed to be assigned randomly with a 75% probability. So, the logistic regression propensity and PyGAM calibrated scores look better than other calibrated scores, which show binomial distributions. For a more interesting test, we should try a propensity model, of which outputs are not probabilities, e.g., GBM or RF, and then see how PyGAM calibration changes the distribution and find the calibration method that generates similar outputs. A simple logistic regression - or sigmoid transformation might work better. |
My apologies, I had notifications turned off. Will take a more detailed look at it 👍 |
I've added a new notebook in a dev branch that works through the calibration question at: This notebook builds on the example from: https://scikit-learn.org/stable/auto_examples/calibration/plot_calibration.html#sphx-glr-auto-examples-calibration-plot-calibration-py It reproduces that example and then adds examples to compare calibration using both pyGAM and Isotonic Regression. Interestingly, calibration with isotonic regression seems to perform better at the discontinuities, with pyGAM showing high-frequency like effects: This should help to motivate the transition to IsotonicRegression from pyGAM. There are also a couple other modifications in the example code for
|
Proposed changes
This removes the dependency on pygam and replaces the use of
LogisticGAM()
incausalml/propensity.py
:calibrate()
withIsotonicRegression()
. Work shown here supports that usingIsotonicRegression()
produces comparable or improves log-loss and brier score loss values.This removes the pygam dependency, which is acting as a constraint on other dependencies.
Types of changes
What types of changes does your code introduce to CausalML?
Put an
x
in the boxes that applyChecklist
Put an
x
in the boxes that apply. You can also fill these out after creating the PR. If you're unsure about any of them, don't hesitate to ask. We're here to help! This is simply a reminder of what we are going to look for before merging your code.