-
Notifications
You must be signed in to change notification settings - Fork 945
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Add support for non-singleton treatment/outcome sets to "has_directed…
…_path" method (#1247) * Modifies has_directed_path and adds test --------- Signed-off-by: Nicholas Parente <[email protected]>
- Loading branch information
Showing
6 changed files
with
47 additions
and
12 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from dowhy.causal_identifier import AutoIdentifier | ||
from dowhy.causal_identifier.identify_effect import EstimandType | ||
from dowhy.graph import build_graph_from_str | ||
|
||
|
||
class TestAutoIdentification(object): | ||
def test_auto_identify_identifies_no_directed_path(self): | ||
# Test added for issue #1250 | ||
graph = build_graph_from_str("digraph{T->Y;A->Y;A->B;}") | ||
identifier = AutoIdentifier(estimand_type=EstimandType.NONPARAMETRIC_ATE) | ||
|
||
assert identifier.identify_effect( | ||
graph, action_nodes=["T", "B"], outcome_nodes=["Y"], observed_nodes=["T", "Y", "A", "B"] | ||
).no_directed_path | ||
assert identifier.identify_effect( | ||
graph, action_nodes=["B", "T"], outcome_nodes=["Y"], observed_nodes=["T", "Y", "A", "B"] | ||
).no_directed_path |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters