-
-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Description
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.