Skip to content
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

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

rahulbshrestha
Copy link
Contributor

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!

@rahulbshrestha rahulbshrestha marked this pull request as draft June 8, 2024 11:49
removed test file from commit

Add notebook and data

Signed-off-by: rahulbshrestha <[email protected]>
@rahulbshrestha rahulbshrestha marked this pull request as ready for review June 20, 2024 10:52
@rahulbshrestha rahulbshrestha marked this pull request as draft June 20, 2024 10:53
@bloebp
Copy link
Member

bloebp commented Jul 29, 2024

@amit-sharma can you take a look?

Copy link

This PR is stale because it has been open for 60 days with no activity.

@github-actions github-actions bot added the stale label Sep 28, 2024
Copy link

This PR was closed because it has been inactive for 7 days since being marked as stale.

@github-actions github-actions bot closed this Oct 13, 2024
@bloebp bloebp reopened this Oct 14, 2024
@bloebp
Copy link
Member

bloebp commented Oct 14, 2024

@amit-sharma any chance to take a look?

@github-actions github-actions bot removed the stale label Oct 15, 2024
Copy link
Member

@amit-sharma amit-sharma left a 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):
Copy link
Member

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
Copy link
Member

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.")

Copy link
Member

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
Copy link
Member

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"
Copy link
Member

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.

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.

3 participants