dodiscover.constraint.LearnInterventionSkeleton#
- class dodiscover.constraint.LearnInterventionSkeleton(ci_estimator, cd_estimator, sep_set=None, alpha=0.05, min_cond_set_size=0, max_cond_set_size=None, max_combinations=None, condsel_method=ConditioningSetSelection.NBRS, second_stage_condsel_method=ConditioningSetSelection.PDS, keep_sorted=False, max_path_length=None, known_intervention_targets=False, n_jobs=None)[source]#
Learn skeleton using observational and interventional data.
An interventional skeleton is a skeleton that is learned from observational and/or interventional data. The interventional skeleton is just the normal skeleton among the observed variables augmented with F-nodes representing interventions and the edges from the F-nodes.
- Parameters:
- ci_estimator
BaseConditionalIndependenceTest
The conditional independence test function.
- cd_estimator
BaseConditionalDiscrepancyTest
The conditional discrepancy test function.
- sep_setdictionary of dictionary of
list
ofset
Mapping node to other nodes to separating sets of variables. If
None
, then an empty dictionary of dictionary of list of sets will be initialized.- alpha
float
, optional The significance level for the conditional independence test, by default 0.05.
- min_cond_set_size
int
The minimum size of the conditioning set, by default 0. The number of variables used in the conditioning set.
- max_cond_set_size
int
, optional Maximum size of the conditioning set, by default None. Used to limit the computation spent on the algorithm.
- max_combinations
int
, optional The maximum number of conditional independence tests to run from the set of possible conditioning sets. By default None, which means the algorithm will check all possible conditioning sets. If
max_combinations=n
is set, then for every conditioning set size, ‘p’, there will be at most ‘n’ CI tests run before the conditioning set size ‘p’ is incremented. For controlling the size of ‘p’, seemin_cond_set_size
andmax_cond_set_size
. This can be used in conjunction withkeep_sorted
parameter to only test the “strongest” dependences.- condsel_method
ConditioningSetSelection
The method to use for testing conditional independence. Must be one of (‘pds’, ‘pds_path’). See Notes for more details.
- keep_sortedbool
Whether or not to keep the considered conditioning set variables in sorted dependency order. If True (default) will sort the existing dependencies of each variable by its dependencies from strongest to weakest (i.e. largest CI test statistic value to lowest). This can be used in conjunction with
max_combinations
parameter to only test the “strongest” dependences.- max_path_length
int
, optional The maximum length of any discriminating path, or None if unlimited.
- n_jobs
int
, optional Number of CPUs to use, by default None.
- ci_estimator
Notes
With interventional data, one may either know the interventional targets from each experimental distribution dataset, or one may not know the explicit targets. If the interventional targets are known, then the skeleton discovery algorithm of [1] is used. That is we learn the skeleton of a AugmentedPAG. Otherwise, we will not know the intervention targets, and use the skeleton discovery algorithm described in [2]. To define intervention targets, one must use the
dodiscover.InterventionalContextBuilder
.References
Methods
evaluate_edge
(data, conditional_test_func, X, Y)Test any specific edge for X || Y | Z.
learn_graph
- ci_estimator#
Callable[[Column, Column, Set[Column]], Tuple[float, float]]
- evaluate_edge(data, conditional_test_func, X, Y, Z=None)#
Test any specific edge for X || Y | Z.