Updating a PGMPY Bayesian Network with new partial evidences #1630
Replies: 3 comments 6 replies
-
More specifically, I am looking for the equivalent of the following operation that is supported in PYBBN (or any other way to accomplish this):
|
Beta Was this translation helpful? Give feedback.
-
@ankurankan , I just noticed that the last discussion thread here was in Jan 2022. Is there a different place where I can ask questions like these? Pls let me know. I am stuck at this place and it is a fairly critical blocker. Combed thru various places where PGMPY discussions are happening and could not find anything. ChatGPT and Bard had very convoluted guidance. Thought I would come straight to the source. Any help would be greatly appreciated. |
Beta Was this translation helpful? Give feedback.
-
@sachinsdesai Sorry, as I am the only one maintaining the package right now, replies can be a bit slow at times. I will just add what I mentioned over email here as well, just in case anyone else has a similar use case.
As you mentioned that the data you are using to update has missing values, the easiest way would be to do data imputation. A couple of ways are possible:
Lastly, another possibility is to use the EM algorithm to learn the model parameters from data with missing values and then somehow combine it with the model learned from expert knowledge. There is no direct method to do this in pgmpy right now. |
Beta Was this translation helpful? Give feedback.
-
Folks, I looked thru all the issues, discussions and the notebooks - but could not find an answer. Hence posting it here.
I have a use-case where I have built a Bayesian Network using static CPDs (not using data, but using "expert knowledge"). I am able to make inferences using
pgmpy.estimators.MaximumLikelihoodEstimator().map_query
- to get expected results. But I am unable to figure out how to accomplish a specific need that I have:With some help from various sources, I tried different things (for example, the
fit_update()
method). It doesn't seem to work for me. When I called fit_update with new partial evidence, it updated the CPD (for the variable that I am interested in) once and after that, never updated it even with a wide range of values for different variables. I played with then_prev_samples
and all that, but nothing helped. I am sure this isn't the right method and I am missing something basic here. Any pointers would be of great help.Beta Was this translation helpful? Give feedback.
All reactions