We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
I'm running into error using pgmpy doing calculations for conditional probability (bayesian network)
This is the structure of the network. weather_chart = BayesianModel([('Weather', 'Temperature'), ('Weather', 'Wind'), ('Weather', 'Rain'), ('Temperature', 'Bring_Jacket'), ('Wind', 'Bring_Jacket'), ('Rain', 'Bring_Jacket'), ('Temperature', 'Bring_Umbrella'), ('Wind', 'Bring_Umbrella'), ('Rain', 'Bring_Umbrella')])
The error I get is when running : model.check_model()
The error I get: ValueError Traceback (most recent call last) in 1 # Check model for correctness ----> 2 weather_chart.check_model()
~/Library/Python/3.9/lib/python/site-packages/pgmpy/models/BayesianNetwork.py in check_model(self) 427 # Check if the values of the CPD sum to 1. 428 if not cpd.is_valid_cpd(): --> 429 raise ValueError( 430 f"Sum or integral of conditional probabilities for node {node} is not equal to 1." 431 )
ValueError: Sum or integral of conditional probabilities for node Temperature is not equal to 1.
The text was updated successfully, but these errors were encountered:
No branches or pull requests
I'm running into error using pgmpy doing calculations for conditional probability (bayesian network)
This is the structure of the network.
weather_chart = BayesianModel([('Weather', 'Temperature'),
('Weather', 'Wind'),
('Weather', 'Rain'),
('Temperature', 'Bring_Jacket'),
('Wind', 'Bring_Jacket'),
('Rain', 'Bring_Jacket'),
('Temperature', 'Bring_Umbrella'),
('Wind', 'Bring_Umbrella'),
('Rain', 'Bring_Umbrella')])
The error I get is when running : model.check_model()
The error I get:
ValueError Traceback (most recent call last)
in
1 # Check model for correctness
----> 2 weather_chart.check_model()
~/Library/Python/3.9/lib/python/site-packages/pgmpy/models/BayesianNetwork.py in check_model(self)
427 # Check if the values of the CPD sum to 1.
428 if not cpd.is_valid_cpd():
--> 429 raise ValueError(
430 f"Sum or integral of conditional probabilities for node {node} is not equal to 1."
431 )
ValueError: Sum or integral of conditional probabilities for node Temperature is not equal to 1.
The text was updated successfully, but these errors were encountered: