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
6.88k stars 916 forks source link

[ENH] Implement the Generalised Complete Adjustment Criterion #1148

Open aryan26roy opened 4 months ago

aryan26roy commented 4 months ago

Implement the functionality to find the adjustment criterion for all common causal graphs: DAGs, PAGs, CPDAGs and MAGs.

aryan26roy commented 4 months ago

@adam2392 , I am writing a working to-do list here, let me know if you want to change the granularity or simply add some more things to it:

aryan26roy commented 4 months ago

@adam2392 I was looking at the current implementation of backdoor criterion in dowhy, and it has a very weird way of handling the graphs. Should I just define the standard pywhy-graphs graph in the test and complete the unit tests part of this PR?

adam2392 commented 4 months ago

Yes. I think the initial work can just use pywhy-graphs. We can revisit how to refactor if necessary once we get a working prototype.

aryan26roy commented 4 months ago

@adam2392 Is this an ok number of unit tests?

adam2392 commented 4 months ago

@adam2392 Is this an ok number of unit tests?

Yes to start.

I didn't take a look at the details to see whether each graph is correct or not.

It would be good to organize them semantically if possible. Graph code is inherently hard to read so usually it's nice to have good documentation for cross developer communication. Some ideas for segmenting them out: DAG, Cpdag, MAG, PAG.

aryan26roy commented 2 months ago

@adam2392 sorry for the delay. Work was hectic. You're right, I can segment them out easily.

aryan26roy commented 2 months ago

@adam2392 How do you want to implement the sketch in dowhy?

adam2392 commented 2 months ago

No problem. I've been backed up

I think a good approach is to define an API similar to whatever is in dowhy currently for any type of identification.

Then let's do some error checks to make sure input is as expected. And then we simply need to implement the various steps of the algo. Proposed in the paper. Let's assume for now each graphical step has a counterpart implemented in pywhy-graphs.

aryan26roy commented 2 months ago

@adam2392 I have completed the skeleton. Made some heavy assumptions in the LLD. Would be great if you can take a look.

amit-sharma commented 3 weeks ago

@aryan26roy is this still an active PR? If so, can you resolve the conversations and share the updated PR?

aryan26roy commented 3 weeks ago

@amit-sharma this is still active! Although the work has been slow. Will share the updated PR soon.

amit-sharma commented 2 weeks ago

great to hear @aryan26roy Do post a message here once the PR is ready for review