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

do_intervention never ends running despite simple query #45

Closed
ironcrypto opened this issue May 8, 2020 · 8 comments
Closed

do_intervention never ends running despite simple query #45

ironcrypto opened this issue May 8, 2020 · 8 comments
Labels
bug Something isn't working

Comments

@ironcrypto
Copy link

ironcrypto commented May 8, 2020

Hi QB––

Description

I am running a do-calculus on a small dataset (116x32) with 2 to 4 discretized buckets.
The BN fits the CPDs in 2 sec, so relatively good perf.

However a simple do-intervention takes forever and even never ends running, I waited several hours then I interrupted kernel.

Steps to Reproduce

$ from causalnex.inference import InferenceEngine
$ ie = InferenceEngine(bn)
$ ie.do_intervention("cD_TropCycl", {1: 0.2, 2: 0.8})
$ print("distribution after do", ie.query()["cD_TropCycl"])

Expected Result

Shouldn't it be running just a few seconds given the low number of buckets?
How long does it normally take?

Actual Result

no results returned after hours running a simple query.

Your Environment

Include as many relevant details about the environment in which you experienced the bug:

  • CausalNex version used (pip show causalnex): 0.5.0
  • Python version used (python -V): python 3.7.6
  • Operating system and version: osx 10.15.14 on 2.3 GHz Quad-Core Intel Core i5

Thank you very much!!

@ironcrypto
Copy link
Author

Hello @qbphilip
Any chance I get get an answer or help on this?
Thank you

@mingli2607
Copy link

Same problem when I do intervention on a little large dataset. Some nodes can be queried easily while some cannot be.

@SteveLerQB SteveLerQB added the bug Something isn't working label Jun 16, 2020
@qbphilip
Copy link
Contributor

@ironcrypto Could you replicate this on a minimum example, e.g. on a small synthetic dataset?

@ironcrypto
Copy link
Author

@qbphilip yes I think so. Do you have such dataset or should I create it?

@SteveLerQB
Copy link
Contributor

Hi @ironcrypto, it would be great if you could provide us this dataset to debug this. Thanks :)

@ironcrypto
Copy link
Author

ironcrypto commented Jun 25, 2020

@SteveLerQB
Sure. here attached the Notebook and the dataset to reproduce.
You will see that I interrupted the last two instructions of Do-Calculus as an effect of very high latency.
I would be curious to see if you get the same problem or if error is on my side. Maybe a bad discretization policy? I doubt because it is pretty simple though.

github_qb_bug_45.zip

@ironcrypto
Copy link
Author

ironcrypto commented Sep 22, 2020

Hi @SteveLerQB @qbphilip
Have you been avale to reproduce the bug or do you observe the same latency?
Thank you

@FrancescaSogaroQB
Copy link
Contributor

thank you @ironcrypto for reporting this. This is also linked to issue #100. The above has been fixed with this commit will be available in the next CausalNex release.

@qbphilip qbphilip mentioned this issue Nov 10, 2021
7 tasks
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

5 participants