https://github.com/papamoon0113/Causal-Discovery-Python-Implement
Hi, there! ๐ Iโm a student studying Causal Discovery, and this page is created to share my implemented codes. All the codes here are implemented by using only numpy, scipy, pandas, and matplotlib.
While studying Causal Discovery, I found that there were few proper code implementation examples online. Most of the code online used pre-existing package, such as networkx, dowhy, cdt, etc., which made it difficult to understand how the underlying algorithm really worked. (There is also a way to read the package code, but it is usually too complicated. ๐) As a result, I decided to implement the code myself based on research papers and books.
I share my code for the people who prefer to study while implementing the code themselves, rather than relying on pre-existing package. I recommend to follow Implementation Procedure below. I hope that my work will be helpful for you. ๐
โ We donโt use networkx. We will implement our own graph class. Visualization, too
Title | Implementation | Notebook url |
---|---|---|
DAG Pattern_base | Foundation of DAG Pattern | Click! |
DAG Pattern_d_separation | Methods related to d-separation | Click! |
DAG Pattern_visualization | Visualization (Force-directed graph drawing) | Click! |
Title | Implementation | Notebook url |
---|---|---|
Nonparametric CI Test_MI | Conditional Mutual Information | Click! |
Nonparametric CI Test_KCIT | KCIT, Kernel-based Conditional Independence Test | Click! |
Title | Implementation | Notebook url |
---|---|---|
Constraint-based Algorithm_basic | Basic algorithm of Constraint-based Algorithm | Click! |
Constraint-based Algorithm_pc | PC algorithm | Click! |
Constraint-based Algorithm_cpc | Conservative PC algorithm | Click! |
[1] Geiger, D., Verma, T., & Pearl, J. (1990). d-Separation: From Theorems to Algorithms. In Machine Intelligence and Pattern Recognition (Vol. 10, Issue C)
[2] Zhang, K., Peters, J., Janzing, D., & Schรถlkopf, B. (2011). Kernel-based conditional independence test and application in causal discovery. Proceedings of the 27th Conference on Uncertainty in Artificial Intelligence, UAI 2011
[3] Metropolitan. (2004). Learning Bayesian Networks. chapter 10.
[4] Verma, T., Pearl, J. (1990). On the Equivalence of Causal Models. Appears in Proceedings of the Sixth Conference on Uncertainty in Artificial Intelligence (UAI1990).
[5] Meek, C. (1995). Causal inference and causal explanation with background knowledge. Conference on Uncertainty in Artificial Intelligence.
[6] Ramsey, J., Spirtes, P., & Zhang, J. (2006). Adjacency-faithfulness and conservative causal inference. Proceedings of the 22nd Conference on Uncertainty in Artificial Intelligence, UAI 2006.
[7] Peter, J., Zanzing, D., Schรถlkopf, B. (2017). Elements of Causal Inference. The MIT Press