Skip to content

mancunian1792/causaldag

 
 

Repository files navigation

This package is still very young and hence maybe be subject to future revision. Use at your own risk.

CausalDAG is a Python package for the creation, manipulation, and learning of Causal DAGs. CausalDAG requires Python 3.5+

Install

Install the latest version of CausalDAG:

$ pip3 install causaldag

Documentation

Documentation is available at https://causaldag.readthedocs.io/en/latest/index.html

Examples for specific algorithms can be found at https://uhlerlab.github.io/causaldag/

Simple Example

Find the CPDAG (complete partially directed acyclic graph, AKA the essential graph) corresponding to a DAG:

>>> import causaldag as cd
>>> dag = cd.DAG(arcs={(1, 2), (2, 3), (1, 3)})
>>> cpdag = dag.cpdag()
>>> iv = dag.optimal_intervention(cpdag=cpdag)
>>> icpdag = dag.interventional_cpdag([iv], cpdag=cpdag)
>>> dag.reversible_arcs()
{(1,2), (2,3)}

License

Released under the 3-Clause BSD license (see LICENSE.txt):

Copyright (C) 2018
Chandler Squires <csquires@mit.edu>

About

Python package for the creation, manipulation, and learning of Causal DAGs

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • HTML 67.4%
  • Python 26.7%
  • JavaScript 5.0%
  • Other 0.9%