Viewcpd#1
Conversation
… the CPD with its values
|
@shark8me, thank you for your contribution. We are going to refrain from incorporating it as it stands, only because it seems to introduce a new dependency to the library (Pandas). We aim to reduce libpgm's dependencies as much as possible in order to ease its installation and keep it lightweight. However, the added functionality of the pretty-printing would certainly make libpgm more useful. If you can replicate the functionality using libpgm's current dependencies, we would be pleased to incorporate the change. Let us know what you think. |
|
That's certainly logical. I've seen other libraries using either pandas or the pretty table library to add the pretty-printing feature. |
|
What types of added functionality from Pandas do you envision? In general, if it improves or expands Bayesian network analysis capability, we would be interested in incorporating it. If it branches into other types of data analysis, it might fit better in a different project with libpgm as a dependency. Also, if the functionality could be attained without the new dependency, we would want to attain it that way. |
|
Here is a simple pure python pretty print alternative: |
Added a method that creates and populates a Pandas dataframe with the all the assignments to all the random variables involved in the CPD, along with the conditional probabilities for each assignments.
The CPD for "Grade" in the default example gets printed this way: