kevinsbello / dagma

A Python 3 package for learning Bayesian Networks (DAGs) from data. Official implementation of the paper "DAGMA: Learning DAGs via M-matrices and a Log-Determinant Acyclicity Characterization"
https://dagma.readthedocs.io/en/latest/
Apache License 2.0
97 stars 20 forks source link

Implications of applying DAGMA on mixed data #4

Closed jiayang97 closed 11 months ago

jiayang97 commented 11 months ago

Hi Kevin, thanks so much for providing the DAGMA algorithm, it runs fast and is more scalable compared to other algorithms I have tried.

I understand that the current algorithm works on either continuous and binary data, but given that a large portion of real-world data consists of a mix of continuous, binary and categorical, can I run the DAGMA linear algorithm on mixed data? I have tried it, and the results seems okay, but I do not know if it is the theoretical right way to do it. Another solution I have considered is to run DAGMA on purely continuous data, identify the relationships then reduce the number of non-essential continuous columns, then run another algorithm that can handle mixed data but is not as scalable (such as DECI) to get the causal graph. Would like to hear your thoughts about this, thanks in advance!

kevinsbello commented 11 months ago

Hi there,

In principle, assuming a linear model on mixed data would not make much sense. However, it could be the case that there are strong correlations that even though one variable is discrete and another is continuous, a linear model can do fine.

In terms of the identifiability of the structure, nothing comes to mind right now for mixed data. Nonetheless, between a linear and nonlinear model, I guess it makes more sense to fit nonlinear models for mixed data, so I would give it a try to DAGMA nonlinear. It will be somewhat slower though due to fitting MLPs for the functionals, so if you have access to GPU would be great.

jiayang97 commented 11 months ago

Hi Kevin, Thanks for taking the time to reply! I understand what you mean, let me try fitting my data with the nonlinear DAGMA and see how it goes. Thanks again :)