dowhy.causal_identifiers package
Submodules
dowhy.causal_identifiers.backdoor module
- class dowhy.causal_identifiers.backdoor.Backdoor(graph, nodes1, nodes2)[source]
Bases:
object
Class for optimized implementation of Backdoor variable search between the source nodes and the target nodes.
- class dowhy.causal_identifiers.backdoor.HittingSetAlgorithm(list_of_sets, colliders={})[source]
Bases:
object
Class for the Hitting Set Algorithm to obtain a approximate minimal set of backdoor variables to condition on for each node pair.
- Parameters
list_of_sets – List of sets such that each set comprises nodes representing a single backdoor path between a source node and a target node.
dowhy.causal_identifiers.id_identifier module
- class dowhy.causal_identifiers.id_identifier.IDExpression[source]
Bases:
object
Class for storing a causal estimand, as a result of the identification step using the ID algorithm. The object stores a list of estimators(self._product) whose porduct must be obtained and a list of variables (self._sum) over which the product must be marginalized.
- add_product(element)[source]
Add an estimator to the list of product.
- Parameters
element – Estimator to append to the product list.
- class dowhy.causal_identifiers.id_identifier.IDIdentifier(graph, estimand_type, method_name='default', proceed_when_unidentifiable=None)[source]
Bases:
CausalIdentifier
Class to perform identification using the ID algorithm.
- Parameters
self – instance of the IDIdentifier class.
estimand_type – Type of estimand (“nonparametric-ate”, “nonparametric-nde” or “nonparametric-nie”).
method_name – Identification method (“id-algorithm” in this case).
proceed_when_unidentifiable – If True, proceed with identification even in the presence of unobserved/missing variables.
- identify_effect(treatment_names=None, outcome_names=None, adjacency_matrix=None, node_names=None)[source]
Implementation of the ID algorithm. Link - https://ftp.cs.ucla.edu/pub/stat_ser/shpitser-thesis.pdf The pseudo code has been provided on Pg 40.
- Parameters
self – instance of the IDIdentifier class.
treatment_names – OrderedSet comprising names of treatment variables.
:param outcome_names:OrderedSet comprising names of outcome variables. :param adjacency_matrix: Graph adjacency matrix. :param node_names: OrderedSet comprising names of all nodes in the graph
- Returns
target estimand, an instance of the IDExpression class.