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

Bug fix: Return zero if there is no directed path from treatment to outcome #332

Merged
merged 2 commits into from Nov 11, 2021

Conversation

amit-sharma
Copy link
Member

  • Added a check for directed path from treatment to outcome
  • If no such path exists, estimator is not called. Effect is zero by definition.

dowhy/causal_graph.py Outdated Show resolved Hide resolved
@pawni
Copy link

pawni commented Nov 11, 2021

I just checked that this implementation fixes the previous bug.

However, should methods like CausalEstimate.get_standard_error handle the missing estimator or should this be handled downstream by the user?

@amit-sharma
Copy link
Member Author

Handling downstream by user should be fine for now. Since the standard error will tell the user "self.estimator not found", which is essentially the same exception we would raise if we handle it in get_standard_error.

@amit-sharma amit-sharma merged commit 3834b8e into master Nov 11, 2021
@amit-sharma amit-sharma deleted the identify/fix-no-directed-edge-bu branch November 11, 2021 14:20
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.

None yet

2 participants