dodiscover.make_context#

dodiscover.make_context(context=None, create_using=<class 'dodiscover.context_builder.ContextBuilder'>)[source]#

Create a new ContextBuilder instance.

Returns:
resultContextBuilder, InterventionalContextBuilder

The new ContextBuilder instance

Notes

Context objects are dataclasses that creates a dictionary-like access to causal context metadata. Copying relevant information from a Context object into a ContextBuilder is all supported with the exception of state variables. State variables are not copied over. To set state variables again, one must build the Context and then call state_variable().

Examples

This creates a context object denoting that there are three observed variables, (1, 2, 3). >>> context_builder = make_context() >>> context = context_builder.variables([1, 2, 3]).build()

Examples using dodiscover.make_context#

Basic causal discovery with DoDiscover using the PC algorithm

Basic causal discovery with DoDiscover using the PC algorithm

Basic causal discovery with DoDiscover using the PC algorithm
Causal discovery with interventional data - Sachs dataset

Causal discovery with interventional data - Sachs dataset

Causal discovery with interventional data - Sachs dataset
Order-based algorithms for causal discovery from observational data without latent confounders

Order-based algorithms for causal discovery from observational data without latent confounders

Order-based algorithms for causal discovery from observational data without latent confounders
Using prior knowledge in order-based algorithms for causal discovery

Using prior knowledge in order-based algorithms for causal discovery

Using prior knowledge in order-based algorithms for causal discovery