Skip to content
/ bbn Public

Bayesian Belief Network CLI/TUI tool and Go module.

License

Notifications You must be signed in to change notification settings

mlange-42/bbn

Repository files navigation

BBN

Test status Go Report Card Go Reference GitHub

Bayesian Belief Network CLI/TUI tool and Go module.

screenshot

Features

  • Visualize, query and explore networks in the interactive TUI app bbni.
  • Supports decision networks (aka influence diagrams), including sequential decisions.
  • Provides logic nodes for logic inference in addition to probabilistic inference.
  • Train and query networks from the command line with bbn.
  • Human-readable YAML format for networks, as well as BIF-XML.
  • Plenty of examples with introductory text, shown in-app.

Installation

Command line tools

Pre-compiled binaries for Linux, Windows and MacOS are available in the Releases.

Alternatively, install the latest development versions of bbn and bbni using Go:

go install github.com/mlange-42/bbn/cmd/bbn@main
go install github.com/mlange-42/bbn/cmd/bbni@main

Library

⚠️ Please be aware that the bbn Go module is still under development and highly unstable.

Add BBN to a Go project:

go get github.com/mlange-42/bbn

Usage

Command line tools

Try the famous sprinkler example:

bbni _examples/bbn/sprinkler.yml

Same example with the command line tool, given some evidence:

bbn inference _examples/bbn/sprinkler.yml -e Rain=no,GrassWet=yes

Train a network from data:

bbn train _examples/bbn/fruits-untrained.yml _examples/bbn/fruits.csv

Also try the other examples in folder _examples. Run them with bbni and play around, but also view their .yml files to get an idea how to create Bayesian Networks.

Library

⚠️ Please be aware that the bbn Go module is still under development and highly unstable.

See the examples in the API reference.

License

This project is distributed under the MIT license.