https://github.com/jackgerrits/bayesnetsampler
Numerical solver for Bayesian networks.
https://github.com/jackgerrits/bayesnetsampler
Last synced: 2 months ago
JSON representation
Numerical solver for Bayesian networks.
- Host: GitHub
- URL: https://github.com/jackgerrits/bayesnetsampler
- Owner: jackgerrits
- Created: 2016-07-20T12:06:01.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2016-08-05T07:35:22.000Z (almost 9 years ago)
- Last Synced: 2025-01-23T06:32:31.108Z (4 months ago)
- Language: C++
- Homepage:
- Size: 253 KB
- Stars: 1
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: readme.md
Awesome Lists containing this project
README
## Build
Run `make` to compile all necessary files and produce a binary called `sampler`.```
make
```## Test
Uses the Google Test framework. https://github.com/google/googletest/To run the included unit and integration tests contained in `test.cpp` :
```
make test
```Note that several integration tests are non-deterministic given the nature of this assignment, however they have been given a large enough range and number of samples such that if it is working correctly it will pass.
## Run
```
./sampler [-r] networkDefinitionFile
```- `-r` - use rejection sampling. Omitting `-r` uses the default likelihood sampling method.
- `networkDefinitonFile` - path to a file containing a network definition. An example definition can be seen in `burglarnetwork.txt`
The program then accepts a query from `stdin` and prints the probability distribution of the query variable to `stdout`. An example query is:
```
P(Burglar | Alarm=true, Earthquake=true)
```