https://github.com/mlange-42/bbn
Bayesian Belief Network CLI/TUI tool and Go module.
https://github.com/mlange-42/bbn
bayesian-inference bayesian-network bbn cli golang tui
Last synced: 3 months ago
JSON representation
Bayesian Belief Network CLI/TUI tool and Go module.
- Host: GitHub
- URL: https://github.com/mlange-42/bbn
- Owner: mlange-42
- License: mit
- Created: 2024-06-06T21:27:24.000Z (12 months ago)
- Default Branch: main
- Last Pushed: 2024-07-15T19:43:06.000Z (10 months ago)
- Last Synced: 2025-01-12T06:40:40.140Z (4 months ago)
- Topics: bayesian-inference, bayesian-network, bbn, cli, golang, tui
- Language: Go
- Homepage:
- Size: 305 KB
- Stars: 2
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- License: LICENSE
Awesome Lists containing this project
README
# BBN
[](https://github.com/mlange-42/bbn/actions/workflows/tests.yml)
[](https://goreportcard.com/report/github.com/mlange-42/bbn)
[](https://pkg.go.dev/github.com/mlange-42/bbn)
[](https://github.com/mlange-42/bbn)Bayesian Belief Network CLI/TUI tool and [Go](https://go.dev) module.

## 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](https://github.com/mlange-42/bbn/tree/main/_examples) with introductory text, shown in-app.## Installation
### Command line tools
Pre-compiled binaries for Linux, Windows and MacOS are available in the
[Releases](https://github.com/mlange-42/bbn/releases).> Alternatively, install the latest development versions of `bbn` and `bbni` using [Go](https://go.dev):
> ```shell
> 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](https://github.com/mlange-42/bbn/tree/main/_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](https://pkg.go.dev/github.com/mlange-42/bbn).
## License
This project is distributed under the [MIT license](./LICENSE).