Pythonic Bayesian Belief Network Package, supporting creation of and exact inference on Bayesian Belief Networks specified as pure python functions.
Pull request Compare This branch is 39 commits behind eBay:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Failed to load latest commit information.


Pythonic Bayesian Belief Network Framework

Allows creation of BBNs with pure Python
functions. Currently three different inference
methods are supported with more to come:

- Message Passing and the Junction Tree Algorithm
- The Sum Product Algorithm
- MCMC Sampling for approximate inference

Other Features

- Automated conversion to Junction Trees
- Inference of Graph Structure from Mass Functions
- Automatic conversion to Factor Graphs
- Seemless storage of samples for future use
- Exact inference on cyclic graphs
- Export of graphs to GraphViz (dot language) format

Please see the short tutorial in the docs/tutorial directory
for a short introduction on how to build a BBN.
There are also many examples in the examples directory.


$ python install
$ pip install -r requirements.txt

Building The Tutorial

$ pip install sphinx
$ cd docs/tutorial
$ make clean
$ make html

Unit Tests:

To run the tests in a development environment:

$ PYTHONPATH=. py.test bayesian/test


1) Change requirement for PMFs to use .value
2) Rename VariableNode to DiscreteVariableNode
3) Add GaussianVariableNode for continuous variables

========= (Many real-world examples listed)

Junction Tree Algorithm: