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

Issue with shapes of values of TabularCPD #44

Open
FiorenzoParascandolo1 opened this issue Jul 19, 2020 · 1 comment
Open

Issue with shapes of values of TabularCPD #44

FiorenzoParascandolo1 opened this issue Jul 19, 2020 · 1 comment

Comments

@FiorenzoParascandolo1
Copy link

`cpd_covid = TabularCPD(variable='Covid',
variable_card=2,
values=[[0.01, 0.15],
[0.99, 0.85]],
evidence=["Follow_rule"],
evidence_card=[2],
state_names={'Covid': ['Positive', 'Negative'],
'Follow_rule': ['Yes', 'No']})

cpd_influence = TabularCPD(variable='Influence',
variable_card=2,
values=[[0.01, 0.09],
[0.99, 0.91]],
evidence=["Follow_rule"],
evidence_card=[2],
state_names={'Influence': ['Positive', 'Negative'],
'Follow_rule': ['Yes', 'No']})

cpd_pneumonia = TabularCPD(variable='Pneumonia',
variable_card=2,
values=[[0,27, 0,26, 0.01, 0.01],
[0.73, 0.74, 0.99, 0.99]],
evidence=['Covid', 'Influence'],
evidence_card=[2, 2])`

evidence_card=[2, 2]) raise TypeError("Values must be a 2D list/array") TypeError: Values must be a 2D list/array

I've a problem with the shapes of evidence. Is there a tutorial which explain its? The notebook "pgmpy_notebook" doesn't work with the representation of arrays of "values"

@ankurankan
Copy link
Member

@FiorenzoParascandolo1 There seems to be a typo in your values argument. Instead of 0.27, it is 0,27. Same for 0.26.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants