Skip to content

jbdatascience/DAG-EQ

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Supervised Full DAG Causal Discovery

This is the implementation of our paper Supervised Full DAG Causal Discovery. If this is helpful for your research, please consider cite our paper.

Running the code

The experiments are sketched in src/main.jl. To run it, you first instantiate the project invironment, then run

julia --project src/main.jl

Or you can use the pre-trained models. Pre-trained models can be found at:

You can also found them in the release page.

Load the pretrained models:

@load "/path/to/model.bson" model

Data can be generated by:

spec = DataSpec(d=10, k=1, gtype=gtype, noise=:Gaussian)
ds, test_ds = spec2ds(spec)

Apply the model on the data:

x, y = next_batch!(test_ds)
pred = model(x)
loss = myσxent(pred, y)
metric = sup_graph_metrics(cpu(σ.(pred)), cpu(y))
@show metrics

script for other methods

The script for running other method is src/baseline.py. You should install those methods (various python and R projects) before running the script.

About

Supervised Full DAG Causal Discovery

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Python 51.0%
  • Julia 46.5%
  • R 2.5%