DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
This commit updates gcm/falsify in the following ways:
Remove the **kwargs for validate_graph and falsify_graph. Instead, validation methods given to those functions should be wrapped in wrap_partial, e.g. if we want to validate a graph G and test local Markov conditions and pairwise dependencies on observations data, we would do
By default (methods=None), validate_graph tests local Markov conditions and falsify_graph tests local Markov conditions and d-separation of parental triples. In this case data has to be set and optionally one can provide independence_test, conditional_independence_test, significance_level, and n_jobs via the keyword arguments of validate_graph / falsify_graph.
Use Enum for some of the constants
In _PValuesMemory the method add_p_value always sets a p-value even if it was set already. This removes the need for the method clear_placeholders and allows p_values to be set to -1, indicating that the CI is not testable (because of missing data for a node, c.f. _compute_p_value)
If for some CI: X, Y | Z any of the nodes has no data (column missing in the provided dataframe), we skip this test and raise a warning.
Instead of using the raw number of violations in the plotted histogram and to compute the p-value, we use the relative number of violations. This will result in different p-values only if we have missing data for some nodes (and thus the number of tests is potentially different between different permutations)
This commit updates
gcm/falsify
in the following ways:**kwargs
forvalidate_graph
andfalsify_graph
. Instead, validation methods given to those functions should be wrapped inwrap_partial
, e.g. if we want to validate a graphG
and test local Markov conditions and pairwise dependencies on observationsdata
, we would doBy default (
methods=None
),validate_graph
tests local Markov conditions andfalsify_graph
tests local Markov conditions and d-separation of parental triples. In this casedata
has to be set and optionally one can provideindependence_test
,conditional_independence_test
,significance_level
, andn_jobs
via the keyword arguments ofvalidate_graph
/falsify_graph
.Enum
for some of the constants_PValuesMemory
the methodadd_p_value
always sets a p-value even if it was set already. This removes the need for the methodclear_placeholders
and allowsp_values
to be set to-1
, indicating that the CI is not testable (because of missing data for a node, c.f._compute_p_value
)