5 · Check and run¶
Run the following commands in the terminal, from the project folder:
Check the files¶
This command reads settings.yml, variables.xlsx and the data without fitting a model.
It reports any inconsistencies and describes how to correct them. If the files are valid, the
output looks like this:
Project Example cohort study
Variables 16 in 5 layers
Layers, in causal order (an arc may only run to the same layer or to a layer further down):
1. Background
Age (years); Sex; Education
2. Lifestyle
Smoking; Alcohol
...
Settings and design table are valid.
Data file my_cohort.csv: 812 participants, all 16 variables found.
If there is a problem, the message states where it is:
Error: variables.xlsx, sheet 'variables': variable 'SBP' is in layer 'Clinicals', which is
not on the 'layers' sheet. Did you mean 'Clinical'?
Correct the file, save it and run layerbn check --figure again. Repeat this until the output
states that the files are valid. Each message is described on the
Error messages page.
With --figure, the command also draws the layers to results/figures/design.png:

Run the analysis¶
Uses 20 resamples. Use this to check that the analysis works and to review the output. The report is labelled as a trial run. Do not report its results.
When the run is finished, open the report:
Output folder¶
results/
├── report.html all results in one page; open this file first
├── figures/ each figure as PNG and as PDF with editable text
├── tables/ each table as CSV, and all tables in tables.xlsx
├── networks/ each network as .bifxml, and the interactive explorer (.html)
└── inputs/ copies of settings.yml and variables.xlsx, and a record of the data file
A new run overwrites results/
To keep earlier results, copy or rename the folder before the next run, or specify another
output folder: layerbn run --output results_2026-12-01.
Reducing the run time
Most of the run time is spent on the bootstrap, and it increases with the number of
resamples. Use --fast while you set up the analysis. learning: search: greedy is
faster but searches less thoroughly. Fewer variables, groups and parents also reduce the
run time.
Using another data file without editing settings.yml
Use layerbn run --data path/to/other_file.csv. This also keeps the location of the data
out of a file that you may share.