dowhy icon indicating copy to clipboard operation
dowhy copied to clipboard

The direction of the graph's edges seems not right

Open lx2m17 opened this issue 2 years ago • 3 comments

Hi guys, I found a wrong place in the example notebook code, the direction of the edges seems put wrong place in the for loops line, can anyone check and fix it? (File path: docs/source/example_notebooks/dowhy_causal_discovery_example.ipynb)

image

lx2m17 avatar Feb 09 '23 12:02 lx2m17

Thanks for spotting this @lx2m17. Would you like to correct this and issue a pull request?

amit-sharma avatar Jun 10 '23 11:06 amit-sharma

Hey, I checked out this bug and figured out it is not an actual issue.

When I run the make_graph function from the image above for the given adjacency matrix, the causal graph is:

graph_dot = make_graph(model.adjacency_matrix_, labels=labels) image

And here's the result when running make_dot from causallearn with the same adjacency matrix:

from causallearn.search.FCMBased.lingam.utils import make_dot
make_dot(model.adjacency_matrix_, labels=labels)
image

Both of them are the same i.e the edges are in the correct direction.

rahulbshrestha avatar Apr 28 '24 12:04 rahulbshrestha

Side note: I found the use of variable confusing at this one part since its used for both Lingam and CausalModel so I've renamed one of it and created a PR.

rahulbshrestha avatar Apr 28 '24 12:04 rahulbshrestha