-
Notifications
You must be signed in to change notification settings - Fork 936
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
Add doubly robust estimator + notebook #1201
base: main
Are you sure you want to change the base?
Conversation
removed test file from commit Add notebook and data Signed-off-by: rahulbshrestha <[email protected]>
9abeacc
to
ffa3a1d
Compare
@amit-sharma can you take a look? |
This PR is stale because it has been open for 60 days with no activity. |
This PR was closed because it has been inactive for 7 days since being marked as stale. |
@amit-sharma any chance to take a look? |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@rahulbshrestha I've added some comments to iterate on the PR.
The estimator is still incomplete. So it needs some work before it can be merged.
from dowhy.utils.api import parse_state | ||
|
||
|
||
class DoublyRobustEstimator(CausalEstimator): |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The comment for this class may need to be changed. This estimator is for the standard backdoor setting when you want to combine propensity and adjustment methods.
estimation of conditional treatment effect over it. | ||
:param first_stage_model: First stage estimator to be used. Default is | ||
linear regression. | ||
:param second_stage_model: Second stage estimator to be used. Default |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
change the default to propensityscore
**kwargs, | ||
) | ||
self.logger.warning("First stage model not provided. Defaulting to sklearn.linear_model.LinearRegression.") | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
do we need a similar custom initialization for the second stage model?
) | ||
|
||
pass | ||
#return estimate |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
these two estimates need to be combined using the doubly robust formula
"metadata": {}, | ||
"outputs": [], | ||
"source": [ | ||
"data = pd.read_csv(\"./learning_mindset.csv\")\n" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
you can add the dataset to the datasets/ folder.
This draft PR addresses this issue, by introducing the doubly robust estimator to doWhy. It also contains a tutorial notebook applying this algorithm to a demo dataset. This is a rough draft, so there will be lots of changes!