Bayesian Neural Network with 'Stan'
Overview
Offers a flexible formula-based interface for building and training Bayesian Neural Networks powered by 'Stan'. The package supports modeling complex relationships while providing rigorous uncertainty quantification via posterior distributions. With features like user chosen priors, clear predictions, and support for regression, binary, and multi-class classification, it is well-suited for applications in clinical trials, finance, and other fields requiring robust Bayesian inference and decision-making. References: Neal(1996) doi:10.1007/978-1-4612-0745-0.
- **New Feature**: Added full support for the
tidymodelsecosystem, including integration withparsnip,recipes,workflows, andtune. - **New Feature**: Added GPU acceleration support for fitting Bayesian Neural Networks via OpenCL and
cmdstanr. - **New Feature**: Introduced model evaluation metrics using Leave-One-Out (LOO) cross-validation (
loo.bnns()) and Watanabe-Akaike Information Criterion (waic.bnns()). - **New Feature**: Added
save_bnns()andload_bnns()functions for easy saving and loading of trained models. - **New Feature**: Added a
plot.bnns()method for visualizing posterior distributions and model convergence. - **New Feature**: Added option to provide character input for
act_fnandout_act_fnarguments. - Changed the package to stable lifecycle and prepared for CRAN submission.
- Removed
cmdstanrfrom package dependencies. It is now accessed dynamically to comply with CRAN policies. - Removed the manual rhub GitHub Actions badge from the README.
- Added
CODE_OF_CONDUCT.md.
From NEWS.md in the release
Install
Health
- OK13 OK2026-10-17
- WARNING12 OK, 1 WARNING2026-10-01
- OK13 OK2026-09-04
- ERROR12 OK, 1 ERROR2026-08-06
- OK13 OK2026-08-05
Show 7 earlier changesHide 7 earlier changes
- NOTE12 OK, 1 NOTE2026-08-01
- OK13 OK2026-06-14
- NOTE10 OK, 3 NOTE2026-06-09
- ERROR8 OK, 4 NOTE, 1 ERROR2026-06-08
- NOTE3 OK, 11 NOTE2026-04-22
- ERROR3 OK, 10 NOTE, 1 ERROR2026-04-18
- NOTE3 OK, 11 NOTE2026-03-10
Documentation
The repository also keeps web-only articles.
- Help pages
- 23 (4 internal)
- Examples that run
- 58%7 run in a plain check · 5 only when donttest examples are enabled (R CMD check --as-cran)
- Exported functions with examples
- 69%
- Documented parameters
- 99%
- Return-value docs
- 92%
- Help pages citing references
- 4%
- bnns HTML
- Using bnns with tidymodels HTML
Downloads
Repository
- PRs merged (all time)
- 0%
- Median days to close, 50 most recently updated closed issues
- 12
- Median days to close, 50 most recently updated closed PRs
- 22
Stars over time
Releases over time
Issues over time
PRs over time
12 development-tooling and community-health practices detected across 6 families in the upstream repository
Checks run against github.com/swarnendu-stat/bnns on 2026-10-11.
The R CMD check workflow runs on Linux
GitHub Pages site last deployed 2026-06-12 · The repository has a site deploy workflow
pkgdown site last built 2026-06-12
Show all practicesHide 2 practices
Dependencies
Code & Tests
People & History
Pick two releases to compare their code metrics.
- 1.0.0Latest2026-06-07 · current release · diff ↗ ·
removed 4 exports
generate_stan_code, generate_stan_code_bin, generate_stan_code_cat, generate_stan_code_contadded 9 exports
L, act_fn, chains, iter, load_bnns, nodes, opencl_diagnostics, save_bnns, warmup - RR 4.6.0 released · 2026-04-24
- RR 4.5.0 released · 2025-04-11
- 0.1.22025-01-13
- RR 4.4.0 released · 2024-04-24
Package metadata
- First published
- 2025-01-13
- Total releases
- 2 / 1 yrs
- License
- MIT + file LICENSE OSI
- Minimum R
- ≥ 4.2.0
- Download size
- 105 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("bnns")This package has no citation file, so citation() returns this entry built from DESCRIPTION.
Cite the R Observatory
For a number measured here: a download total, a coverage figure, an archival date.
From data release v2026-10-17, which the citation names so these numbers can be found later. More on citing and the projects behind them.