layerbn learns a Bayesian network from cohort data in which you decide the order of the
variables. You place them in ordered layers, for example background, exposures, baseline
measures, outcome, and an arc may only run to the same layer or a later one. The data decide
which of the permitted arcs are present, how stable each one is under resampling, and how
much each variable tells you about the outcome. You describe the study in a spreadsheet and
a short settings file; no code needed.
Example output on simulated data. Layers are the coloured bands, in causal order. Arc width is the mutual information between two variables; arc colour and the percentage on each arc give the share of bootstrap resamples that contain it.
Requires Python 3.11 or newer.
pip install "layerbn @ git+https://github.com/umcu/layerbn@v3.0.0"
layerbn init my-study # a project folder with a worked example
layerbn run my-study --fast # about 20 secondsThen open my-study/results/report.html: every figure and table, a note on how to read each,
a methods paragraph, and an interactive explorer of the network.
| Start here | Install, and a tour of the worked example. |
| Your own study | Six steps from a data table to a report you can publish. |
| Reading the results | What each figure and number means, and what it does not. |
| Reference | Every column, setting, command and function. |
| Error messages | What a message means and what to change. |
Coming from version 2? layerbn migrate spec.yml converts the old file; see
upgrading.
The network shows associations supported by the data in the order you assumed. It is not an estimate of causal effects.
git clone https://github.com/umcu/layerbn
cd layerbn
pip install -e ".[dev,notebook,docs]"
pytest # the whole suite, about a minute
pytest -m "not slow" # skip the end-to-end runs
ruff check layerbn tests
mkdocs serve # the documentation at http://127.0.0.1:8000
python docs/assets/build_logo.py # redraw the logoReleased under the MIT licence. Citation metadata is in
CITATION.cff; see citing layerbn. Version 1.2.1 and
earlier were released as vcibayes. The Zenodo concept DOI covers all versions under both
names.
Developed in the Vascular Cognitive Impairment (VCI) research group at UMC Utrecht, department of Neurology and Neurosurgery. This project was led by Malin Overmars, PhD. Networks are fitted with pyAgrum.