py-why / causal-learn

Causal Discovery in Python. It also includes (conditional) independence tests and score functions.
https://causal-learn.readthedocs.io/en/latest/
MIT License
1.14k stars 187 forks source link

Mixed data example #31

Open sailinz opened 2 years ago

sailinz commented 2 years ago

May I know if there are any examples of causal-learn usage on mixed data (categorical and continuous/ordinal)? This is supported in tetrad. Many thanks!

jdramsey commented 2 years ago

Hi @sailinz-- as you probably know we have two methods in Java Tetrad for the mixed discrete/Gaussian case:

(1) Conditional Gaussian

(2) Degenerate Gaussian

Here are the papers for them, respectively:

Andrews, B., Ramsey, J., & Cooper, G. F. (2018). Scoring Bayesian networks of mixed variables. International journal of data science and analytics, 6(1), 3-18.

Andrews, B., Ramsey, J., & Cooper, G. F. (2019, July). Learning high-dimensional directed acyclic graphs with mixed data-types. In The 2019 ACM SIGKDD Workshop on Causal Discovery (pp. 4-21). PMLR.

Our colleague Bryan Andrews (first author on these papers) is a great Python programmer and has the degenerate Gaussian score (I think also test?) coded up in Python, which he is willing to contribute. If all goes well we'll have that in causal-learn in the near future. He doesn't have a Python version of conditional Gaussian, but perhaps we could code that up separately.

Anyway we'll start these conversations with the causal-learn programmers soon.

tofuwen commented 2 years ago

Hi @jdramsey and @bja43, after discussed with Kun, we think this is really needed and a great feature we should support. I am wondering whether @bja43 can contribute your code to our causal-learn library to support mixed data? :)

jdramsey commented 2 years ago

Hi, I sent Bryan's code to Yujia and Wei, but I neglected to cc you--maybe you can get it from them? They were going to adapt it to causal-learn. It's working code. Bryan is a bit overworked at the moment, as am I, unfortunately. :( It's the code for degenerate Gaussian.

jdramsey commented 2 years ago

Also, I'm not sure precisely what your real-world name is :)

jdramsey commented 2 years ago

Maybe you can send me an email :)

tofuwen commented 2 years ago

haha, thanks @jdramsey ! :)

I am Yewen Fan :)

priamai commented 12 months ago

Related to: https://github.com/py-why/causal-learn/issues/139 and I would also mention this paper:

Raghu VK, Poon A, Benos PV. Evaluation of Causal Structure Learning Methods on Mixed Data Types. Proc Mach Learn Res. 2018 Aug;92:48-65. PMID: 31080946; PMCID: PMC6510516.

From: https://www.ncbi.nlm.nih.gov/pmc/articles/PMC6510516/