Bayes Nets, Belief Networks, and PyMC

What’s your preferred python-ecosystem library for bayesian/belief network modeling?

I just came across this thread. In 2018 I wrote a python interface to R bnlearn: https://github.com/cs224/pybnl. I updated this to rpy2 version 3 last year. In 2018 R bnlearn was the most comprehensive free solution for working with bayesian networks. Have a look at some of the examples: https://github.com/cs224/pybnl/tree/master/examples. There is also an example that demonstrates parameter learning.

The book Bayesian Networks in R also helps.

2 Likes

hi everyone,

this is a great thread! I am facing a similar question currently:

Currently working in Academia and fluent in both R and Python. I worked a lot with Bayesian (Hierarchical Generalized) Linear Models but due to interest in causal modeling encountered more and more literature about Bayesian Networks. I am looking for a great package to implement Bayesian Networks for both my academic work but also such that I might be able to step over to Industry after my current contract.

Any new developments on which package might be the best to built this competence @drbenvincent ?

Pyro looks really very interesting but I have not seen people talk about it much here. If people can give recommendations on which packages work best that would be great! With best I mean that a package is as such that it is versatile by allowing different use cases of Bayesian Networks as well as allowing different most common operations that are common in industry and academia.

Thanks!
Anton

Hi, if I’m using pymc5, how do I convert this code? I think I need to convert the theano shared variable to pm.Data, but I’m not sure how to go about it.
Also, if I have ten variables instead of two (smoker, covid) here. Is there any other function that’s more efficient than the lookup table used here?