Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

graph should be directed acyclic #1223

Open
asha24choudhary opened this issue Jul 5, 2024 · 2 comments
Open

graph should be directed acyclic #1223

asha24choudhary opened this issue Jul 5, 2024 · 2 comments
Labels
question Further information is requested

Comments

@asha24choudhary
Copy link

Hi. I have a dataset and I do not have ground truth of the data. What I'm doing is causal discovery using FCI from causal learn library for instance and then I get an adjacency matrix like
([[ 0, 0, 0, 2, 0],
[ 0, 0, 2, 0, 2],
[ 0, 2, 0, 2, -1],
[ 1, 0, 1, 0, -1],
[ 0, 1, 1, 1, 0]]). then i create a networkx graph save the graph into .gml format (test.gml) and when i do

Create the dowhy Causal Model

        model = CausalModel(
            data=df,
            treatment=treatment,
            outcome=outcome,
            graph='test.gml'
        )

Identifying the causal effect

        identified_estimand = model.identify_effect()
        print(identified_estimand)

i get
NetworkXError: graph should be directed acyclic. what should I do to get rid of this error.

I removed the graph as well and identified the effect, but can I rely on this effect or could you please tell me how shall i proceed. i want to determine the effect of the treatment over the outcome, can i use the graph from causal discovery algorithm or what shall i do?

Thank you in advance :)

@asha24choudhary asha24choudhary added the question Further information is requested label Jul 5, 2024
@asha24choudhary asha24choudhary closed this as not planned Won't fix, can't repro, duplicate, stale Jul 5, 2024
Copy link

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

@github-actions github-actions bot added the stale label Jul 20, 2024
@amit-sharma
Copy link
Member

FCI outputs a Partial ancestral graph (PAG) whereas DoWhy expects a standard directed acyclic graph (DAG).
You will need to convert your PAG to a simple graph with directed edges.
Can you share a visualization of your graph?

@github-actions github-actions bot removed the stale label Jul 24, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
question Further information is requested
Projects
None yet
Development

No branches or pull requests

2 participants