Skip to content

Issue with shapes of values of TabularCPD #44

Open
@FiorenzoParascandolo1

Description

`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"

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions