You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
DoWhy's has_directed_path method checks for a directed path between the action node at index 0, and outcome node at index 0. AutoIdentifier's identify_effect_auto method exits if there is no directed path.
Thus, if you call identify_effect_auto() with two action nodes, where one has a path to the (first) outcome node and the other does not, then you get different results.
The following two code snippets have one different line, action_nodes= ['treatment', 'independent_variable'] vs action_nodes= ['independent_variable', 'treatment']
The first:
from dowhy.causal_identifier import AutoIdentifier, EstimandType
Identifier = AutoIdentifier(EstimandType.NONPARAMETRIC_ATE)
causal_graph = """digraph {
treatment;
independent_variable;
outcome;
treatment->outcome;
}"""
G = to_nx_graph(causal_graph) # code for to_nx_graph not in snippet
eff = Identifier.identify_effect(
G,
action_nodes= ['treatment', 'independent_variable'],
outcome_nodes= ['outcome'],
observed_nodes= ['treatment', 'independent_variable', 'outcome'],
)
print(eff)
This gives back
The second:
from dowhy.causal_identifier import AutoIdentifier, EstimandType
Identifier = AutoIdentifier(EstimandType.NONPARAMETRIC_ATE)
causal_graph = """digraph {
treatment;
independent_variable;
outcome;
treatment->outcome;
}"""
G = to_nx_graph(causal_graph) # code for to_nx_graph not in snippet
eff = Identifier.identify_effect(
G,
action_nodes= ['independent_variable', 'treatment'],
outcome_nodes= ['outcome'],
observed_nodes= ['treatment', 'independent_variable', 'outcome'],
)
print(eff)
This gives back
DoWhy version 0.11.1
The text was updated successfully, but these errors were encountered:
DoWhy's has_directed_path method checks for a directed path between the action node at index 0, and outcome node at index 0. AutoIdentifier's identify_effect_auto method exits if there is no directed path.
Thus, if you call identify_effect_auto() with two action nodes, where one has a path to the (first) outcome node and the other does not, then you get different results.
The following two code snippets have one different line,
action_nodes= ['treatment', 'independent_variable']
vsaction_nodes= ['independent_variable', 'treatment']
The first:
This gives back
The second:
This gives back
The text was updated successfully, but these errors were encountered: