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 operator on evidence #1701

Open
zzzrbx opened this issue Nov 1, 2023 · 1 comment
Open

do operator on evidence #1701

zzzrbx opened this issue Nov 1, 2023 · 1 comment
Labels

Comments

@zzzrbx
Copy link

zzzrbx commented Nov 1, 2023

When using the .query method to obtain the effect of Y on X using the do operator, and some evidence Z, is it possible that depending on which nodes are in Z it may not be possible to isolate the causal path from association paths? Would the API return an error?

@ankurankan
Copy link
Member

@zzzrbx Unfortunately, this doesn't throw an error at the moment and would return incorrect results.

A minimal reproducible example for reference:

In [29]: model = BayesianNetwork([('X', 'Y'), ('X', 'Z'), ('Y', 'Z')])

In [30]: model_cpds = model.get_random_cpds(n_states=3)

In [31]: from pgmpy.inference import CausalInference

In [32]: infer.query(['Y'], do={'X': 1}, evidence={'Z': 0})
Out[32]: <DiscreteFactor representing phi(Y:3) at 0x7faab2a0e500>

@ankurankan ankurankan added the Bug label Nov 20, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants