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
induced_graph
example in the documentation of Variable Elimination fails
#1724
Comments
@mroavi This doesn't throw any errors for me: In [2]: import numpy as np
...: import pandas as pd
...: from pgmpy.models import BayesianNetwork
...: from pgmpy.inference import VariableElimination
...: values = pd.DataFrame(np.random.randint(low=0, high=2, size=(1000, 5)),
...: columns=['A', 'B', 'C', 'D', 'E'])
...: model = BayesianNetwork([('A', 'B'), ('C', 'B'), ('C', 'D'), ('B', 'E')])
...: model.fit(values)
...: inference = VariableElimination(model)
...: inference.induced_width(['C', 'D', 'A', 'B', 'E'])
Out[2]: 3 Could you please check which version of networkx you are using? I am using the latest 3.2.1 |
I also have networkx 3.2.1. Here is the rest of my installed dependencies: pip list
These are the steps I used to create my environment: python -m venv venv
source venv/bin/activate
pip install --upgrade pip
pip install pgmpy ipython |
@mroavi Interesting. I can't think of any other reason this could be happening. Could you maybe check the networkx version in your python prompt just to make sure that the it is using the correct environment? import networkx
networkx.__version__ |
Subject of the issue
induced_graph
example in https://pgmpy.org/exact_infer/ve.html throws the following error:Your environment
Steps to reproduce
Run the
induced_graph
example in https://pgmpy.org/exact_infer/ve.html:Expected behaviour
Executing the last line should result in the induced width.
Actual behaviour
The following error is thrown:
The text was updated successfully, but these errors were encountered: