dowhy icon indicating copy to clipboard operation
dowhy copied to clipboard

[ENH] Implement the Generalised Complete Adjustment Criterion

Open aryan26roy opened this issue 1 year ago • 14 comments
trafficstars

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

aryan26roy avatar Mar 03 '24 04:03 aryan26roy

@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:

  • [x] Implement a few unit tests that return adjustable vs not
  • [ ] Implement the sketch of the algorithm in dowhy
  • [ ] Patch any necessary graph search algorithms into pywhy-graphs
  • [ ] Implement a short example in the docs demonstrating usage
  • [ ] Merge PR and have pywhy-graphs be an optional dependency.

aryan26roy avatar Mar 03 '24 04:03 aryan26roy

@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?

aryan26roy avatar Mar 03 '24 04:03 aryan26roy

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.

adam2392 avatar Mar 03 '24 04:03 adam2392

@adam2392 Is this an ok number of unit tests?

aryan26roy avatar Mar 06 '24 13:03 aryan26roy

@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.

adam2392 avatar Mar 06 '24 14:03 adam2392

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

aryan26roy avatar Apr 09 '24 12:04 aryan26roy

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

aryan26roy avatar Apr 09 '24 12:04 aryan26roy

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.

adam2392 avatar Apr 11 '24 06:04 adam2392

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

aryan26roy avatar Apr 13 '24 09:04 aryan26roy

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

amit-sharma avatar Jun 13 '24 07:06 amit-sharma

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

aryan26roy avatar Jun 13 '24 17:06 aryan26roy

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

amit-sharma avatar Jun 18 '24 05:06 amit-sharma

This PR is stale because it has been open for 60 days with no activity.

github-actions[bot] avatar Aug 18 '24 01:08 github-actions[bot]

@amit-sharma @adam2392 I will go on updating this PR as the upstream code is updated and the design of the APIs becomes more concrete.

aryan26roy avatar Aug 26 '24 13:08 aryan26roy