dodiscover.ci.Oracle#
- class dodiscover.ci.Oracle(graph, included_nodes=None)[source]#
Oracle conditional independence testing.
Used for unit testing and checking intuition.
- Parameters:
- graph
nx.DiGraph
|Graph
The ground-truth causal graph.
- graph
Methods
test
(df, x_vars, y_vars[, z_covariates])Conditional independence test given an oracle.
- test(df, x_vars, y_vars, z_covariates=None)[source]#
Conditional independence test given an oracle.
Checks conditional independence between ‘x_vars’ and ‘y_vars’ given ‘z_covariates’ of variables using the causal graph as an oracle. The oracle uses d-separation statements given the graph to query conditional independences. This is known as the Markov property for graphs [1][2].
- Parameters:
- df
pd.DataFrame
of shape (n_samples, n_variables) The data matrix. Passed in for API consistency, but not used.
- x_varsnode
A node in the dataset.
- y_varsnode
A node in the dataset.
- z_covariates
set
The set of variables to check that separates x_vars and y_vars.
- df
- Returns:
References
Examples using dodiscover.ci.Oracle
#
Basic causal discovery with DoDiscover using the PC algorithm