Causal discovery is the process of inferring causal relationships between variables from observational data. This repository aims to provide a collection of causal discovery algorithms implemented in Python.
This repository uses Poetry as a dependency manager. To install the dependencies, run:
$ poetry installYou can install the package from PyPI:
$ pip install causal-discoveryexample usage:
from causal_discovery.algos.notears import NoTears
# load dataset
dataset = ...
# initialize model
model = NoTears(
rho=1,
alpha=0.1,
l1_reg=0,
lr=1e-2
)
# learn the graph
_ = model.learn(dataset)
# adjacency matrix
print(model.get_result())| Algorithm | Reference |
|---|---|
| NOTEARS | DAGs with NO TEARS: Continuous Optimization for Structure Learning, 2019 |
This is the example of the results of the algorithm.
How to read this figure: for any value in coordinate (x, y) means the causal effect from y -> x.
