py-why / dowhy

DoWhy is a Python library for causal inference that supports explicit modeling and testing of causal assumptions. DoWhy is based on a unified language for causal inference, combining causal graphical models and potential outcomes frameworks.
https://www.pywhy.org/dowhy
MIT License
7.04k stars 924 forks source link

Is There a Way to Generate a Weighted Causal Graph in DoWhy Using an Existing Causal DAG and Dataset? #1253

Open Strugoeden121 opened 2 weeks ago

Strugoeden121 commented 2 weeks ago

I have an existing causal DAG and a corresponding dataset that I'm working with. I am interested in generating a weighted causal graph where each edge in the graph has a weight representing the strength of the causal relationship between the connected variables (nodes).

I understand that DoWhy allows for identifying and estimating causal effects between treatment and outcome, but is there a built-in way to:

Assign weights to all the edges in the graph (e.g., by estimating the causal effect for each edge)? Generate a weighted DAG automatically from the identified causal relationships in the dataset? If this isn't directly supported, could you suggest a potential workflow for calculating these weights using DoWhy or a combination of libraries?

Thank you

emrekiciman commented 2 weeks ago

Hi @Strugoeden121, DoWhy's graphical causal models functionality might be what you are looking for. Here's an example: https://www.pywhy.org/dowhy/v0.11.1/example_notebooks/gcm_basic_example.html

There are also more sophisticated causal discovery methods in DoWhy's sibling library, https://causal-learn.readthedocs.io/en/latest/

github-actions[bot] commented 1 day ago

This issue is stale because it has been open for 14 days with no activity.