Getting started
Installation
Requirements
python 3
numpy
networkx
pandas
scipy
scikit-learn
statsmodels
pydot
(For visualization)
matplotlib
graphviz
pygraphviz (might not support the most recent Mac)
Install via PyPI
To use causal-learn, we could install it using pip:
(.venv) $ pip install causal-learn
Install from source
For development version, please kindly refer to our GitHub Repository.
Running examples
For search methods in causal discovery, there are various running examples in the ‘tests’ directory in our GitHub Repository, such as TestPC.py and TestGES.py.
For the implemented modules, such as (conditional) independent test methods, we provide unit tests for the convenience of developing your own methods.
Quick benchmarking
To help users get a quick sense of the running time of the algorithms of interest, we conducted benchmarking for several methods. We consider datasets with number of variables from {10, 25, 50, 100} and average degree from {2, 3, 4, 5}. The random graphs are Erdős-Rényi graphs. The average degree is the average number of edges connected to a node. We simply calculate it by dividing the sum of degrees by the total number of nodes in the graph. The sample size is 1000. All algorithms were run on a single cluster node with 8 CPUs (Intel Xeon E5-2470) and 16 GB Memory. We denote running time as ‘>D’ if it is more than one day. All results are average over 10 runs with different random seeds.
Contributors
Team Leaders: Kun Zhang, Joseph Ramsey, Mingming Gong, Ruichu Cai, Shohei Shimizu, Peter Spirtes, Clark Glymour
Coordinators: Biwei Huang, Yujia Zheng, Wei Chen
Developers:
Wei Chen, Biwei Huang, Yuequn Liu, Zhiyi Huang, Feng Xie: PC, FCI, GES, GIN, and graph operations.
Mingming Gong, Erdun Gao: PNL, ANM, Granger causality, and KCI.
Shohei Shimizu, Takashi Nicholas Maeda, Takashi Ikeuchi: LiNGAM-based methods.
Madelyn Glymour: several helpers.
Ruibo Tu: Missing-value/test-wise deletion PC.
Wai-Yin Lam: PC.
Biwei Huang: CD-NOD.
Ignavier Ng, Yujia Zheng: Exact search.
Joseph Ramsey, Wei Chen, Zhiyi Huang: Evaluations.