Replies: 1 comment 3 replies
-
@borjasor Unfortunately, continuous and hybrid (continuous + discrete) factors are not fully supported yet. |
Beta Was this translation helpful? Give feedback.
3 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
First of all congratulate the team for 'pgmpy', it is a great tool!
Hopefully someone can guide me on how to implement this case.
I define a model with two nodes:
model = BayesianNetwork([('A', 'B')])
'A' is a discrete variable with 4 estates, its CPD is defined by:
cpd_A = TabularCPD(variable='A', variable_card=4, values=[[0.25], [0.25], [0.25], [0.25]], state_names={'A': ['one', 'two', 'three', 'four']})
'B' is a continuous variable with a different 'PDF' for each evidence of 'A';
one_factor = ContinuousFactor(['B'], pdf_one)
two_factor = ContinuousFactor(['B'], pdf_two)
three_factor = ContinuousFactor(['B'], pdf_three)
four_factor = ContinuousFactor(['B'], pdf_four)
The question is how can I assign these PDFs of B to the BayesianNetwork 'model'?
Thank you for your help.
Beta Was this translation helpful? Give feedback.
All reactions