Git Product home page Git Product logo

Comments (10)

amit-sharma avatar amit-sharma commented on May 29, 2024 1

Thanks for checking @rahulbshrestha Looks like this issue is resolved in the current version. We can close this issue.

from dowhy.

akelleh avatar akelleh commented on May 29, 2024

Great suggestion. We might need a broader overhaul of logging and exception handling. What do you think @amit-sharma ?

from dowhy.

yemaedahrav avatar yemaedahrav commented on May 29, 2024

Is this error caused when calling the 'CausalModel()' when it internally creates the graph through the 'CausalGraph()' API or somewhere else? because I am not able to reproduce the error locally.

from dowhy.

amit-sharma avatar amit-sharma commented on May 29, 2024

I think this error is raised when you input your own graph as a string and forget to add all required nodes. So if you provide a dot graph with missing nodes, and then call CausalModel with that graph, it should throw this error.

from dowhy.

lgmoneda avatar lgmoneda commented on May 29, 2024

Hi! I'm unsure if it persists since I'm not currently using the library. But the point was that the error message didn't help as much as it could in identifying what the missing nodes were.

from dowhy.

rahulbshrestha avatar rahulbshrestha commented on May 29, 2024

Hey @amit-sharma! I would like to help out in fixing this bug. Can you let me know what kind of error message do you expect?

from dowhy.

amit-sharma avatar amit-sharma commented on May 29, 2024

thanks for contributing, @rahulbshrestha It will be nice to output an error message that describes the source of the bug. Something like, "Some nodes are missing in the graph: {node1name, node2name} "

from dowhy.

rahulbshrestha avatar rahulbshrestha commented on May 29, 2024

I can't seem to reproduce this issue, how can I provide a dot graph with missing nodes such that the KeyError appears?

Experimenting with this:

# With DOT string
model=CausalModel(
        data = df,
        treatment='X',
        outcome='Y',
        graph="digraph {Z -> X;Z -> Y;X -> Y;}"
        )
model.view_model()

where, df consists of X,Y and Z as columns.

I'm not sure if @lgmoneda meant in this case

# With GML string
model=CausalModel(
        data = df,
        treatment='X',
        outcome='Y',
        graph="""graph[directed 1 node[id "Z" label "Z"]
                    node[id "X" label "X"]
                    #node[id "Y" label "Y"]
                    edge[source "Z" target "X"]
                    edge[source "Z" target "Y"]
                    edge[source "X" target "Y"]]"""

        )
model.view_model()

where an NetworkXError: edge #1 has undefined target 'Y' error is thrown if we remove the node Y.

from dowhy.

amit-sharma avatar amit-sharma commented on May 29, 2024

Try this. Does the following code raise the error?

model=CausalModel(
data = df,
treatment='X',
outcome='Y',
graph="digraph {Z -> X;}"
)
model.view_model()

from dowhy.

rahulbshrestha avatar rahulbshrestha commented on May 29, 2024

Nope, it works perfectly fine
image

from dowhy.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.