Skip to content
This repository has been archived by the owner. It is now read-only.


Switch branches/tags
Pythonic Bayesian Belief Network Framework

Allows creation of Bayesian Belief Networks
and other Graphical Models with pure Python
functions. Where tractable exact inference
is used. Currently four different inference
methods are supported with more to come.

Graphical Models Supported

- Bayesian Belief Networks with discrete variables
- Gaussian Bayesian Networks with continous variables having gaussian distributions

Inference Engines

- Message Passing and the Junction Tree Algorithm
- The Sum Product Algorithm
- MCMC Sampling for approximate inference
- Exact Propagation in Gaussian Bayesian Networks

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
- Discrete and Continuous Variables (with some limitations)
- Minimal dependancies on non-standard library modules.

Please see the short tutorial in the docs/tutorial directory
for a short introduction on how to build a Bayesian Belief Network.
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

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

Junction Tree Algorithm:

Guassian Bayesian Networks:


Pythonic Bayesian Belief Network Package, supporting creation of and exact inference on Bayesian Belief Networks specified as pure python functions.



Code of conduct





No packages published