API#
This is the application programming interface (API) reference
for classes (CamelCase
names) and functions
(underscore_case
names) of dodiscover, grouped thematically by analysis
stage.
Context for causal discovery#
Rather than just data, in many cases structure learning
has additional “context”, in the form of apriori knowledge of
the structure, or additional datasets from different environments.
All structure learning algorithms in dodiscover
pass in a Context
object rather than just data. One should use our builder make_context
API for construction of the Context class.
See docs for Context
and make_context
for more information.
|
Create a new ContextBuilder instance. |
A builder class for creating observational data Context objects ergonomically. |
|
A builder class for creating observational+interventional data Context objects. |
|
|
Context of assumptions, domain knowledge and data. |
Constraint-based structure learning#
|
Learn a skeleton graph from observational data without latent confounding. |
|
Learning a skeleton from a semi-markovian causal model. |
|
Learn skeleton using observational and interventional data. |
|
Available methods for selecting the conditioning sets when learning a skeleton. |
|
Peter and Clarke (PC) algorithm for causal discovery. |
|
The Fast Causal Inference (FCI) algorithm for causal discovery. |
|
Interventional (Psi) FCI algorithm. |
Order-based structure learning#
|
The CAM (Causal Additive Model) algorithm for causal discovery. |
|
The SCORE algorithm for causal discovery. |
|
The DAS (Discovery At Scale) algorithm for causal discovery. |
|
The NoGAM (Not only Gaussian Additive Model) algorithm for causal discovery. |
Comparing causal discovery algorithms#
|
Compute the confusion matrix comparing a predicted graph from the true graph. |
|
Compute structural hamming distance. |
|
Compute topological ordering divergence. |
Typing#
We define some custom types to allow 3rd party packages
to work with mypy
.
Graph protocols#
|
Protocol for graphs to work with dodiscover algorithms. |
|
Protocol for equivalence class of graphs. |
Conditional Testing#
Dodiscover experimentally provides an interface for conditional independence testing and conditional discrepancy testing (also known as k-sample conditional independence testing).
Conditional Independence Testing#
Testing for conditional independence among variables is a core part of many causal inference procedures, such as constraint-based structure learning.
Abstract class for any conditional independence test. |
|
|
Oracle conditional independence testing. |
|
Methods |
|
Methods |
|
Methods |
|
Methods |
|
Conditional mutual information independence test. |
|
Methods |
|
Methods |
Conditional k-sample testing#
Testing for conditional discrepancy among variables is a core part of many causal inference procedures, such as constraint-based structure learning.
Abstract class for any conditional discrepancy test. |
|
|
Kernel conditional discrepancy test among conditional distributions. |
|
Bregman divergence conditional discrepancy test. |
Utilities#
Testing for conditional discrepancy among variables is a core part of many causal inference procedures, such as constraint-based structure learning.
|
Compute a kernel matrix and corresponding width. |
|
Compute the centered correntropy of a matrix. |
|
Compute Von Neumann divergence between two PSD matrices. |
|
Compute f-divergence upper bound on KL-divergence. |
|
Compute f-divergence upper bound on KL-divergence. |
Other utilities include support for Monte-Carlo testing for conditional independence.
|
Generate kNN in subspace. |
|
Compute a permutation of neighbors with restrictions. |