Skip to content

Bayesian Neural Network with 'Stan'

0packages depend
3Kdownloads / year
90.3%test coverage
13/13flavors OK

Overview

About

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.

Changes in 1.0.0
  • **New Feature**: Added full support for the tidymodels ecosystem, including integration with parsnip, recipes, workflows, and tune.
  • **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() and load_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_fn and out_act_fn arguments.
  • Changed the package to stable lifecycle and prepared for CRAN submission.
  • Removed cmdstanr from 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

CRAN checks
13OK
Slowest check: 2.4 min · r-oldrel-windows-x86_64
Status changes
  • 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
Advisories

none known

Documentation

In release 1.0.0
READMEYes · 572 wordsVignettesYes · 2 · evaluation depends on the environmentNEWSYes · 100% structured · mentions 1.0.0Citation fileNoWebsiteYes · pkgdown

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%

Downloads

3K
CRAN downloads in the past year
Rank #10,808 · ~8/day · ~247/mo
Daily download trend is not available in this view yet.
45730 days
94590 days
3K1 year
Compare downloads with other packages →
Also on95 r2u28 autocran

Repository

4Stars
0Forks
0Open issues
0Open PRs
2Releases
84Commits
1Commit identities
84 commits · Last activity 2026-06-12 · 0% stars, 30d · Default branch at 1.0.0.9000, ahead of CRAN 1.0.0 (checked 2026-10-11)
Responsiveness
How these are sampled
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

2025-05-01 · 32026-07-07 · 4
PracticesBeta

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.

Continuous integration (2)
GitHub ActionsR CMD check workflow

The R CMD check workflow runs on Linux

Governance and community (1)
Code of conduct
Docs source (4)
README.Rmdpkgdown

GitHub Pages site last deployed 2026-06-12 · The repository has a site deploy workflow

pkgdown site last built 2026-06-12

Coverage (1)
Coverage reporting
Show all practicesHide 2 practices
CRAN release process (3)
cran-comments.mdrevdep/CRAN-SUBMISSION
Lint, format, editor (1)
RStudio project
How this is detected·Detection ruleset v3 (2026-09-26)

Dependencies

Declared dependencies
25 external dependencies (excludes base and recommended)

Installing bnns adds 49 packages (24 with compiled code, 44 MB of source tarballs). Heaviest: BH 14 MB, ggplot2 6.0 MB, loo 2.7 MB.

Depends (1)
R >= 4.2.0
LinkingTo (0)
none
Enhances (0)
none
Reverse dependencies
0direct
0indirect

Nothing depends on this yet.

People & History

People (1)
Author, Maintainer since 0.1.2 (2025), Copyright holder
Releases (2)

Pick two releases to compare their code metrics.

  • 1.0.0Latest
    record
    2026-06-07 · current release · diff ↗ ·
    removed 4 exports
    generate_stan_code, generate_stan_code_bin, generate_stan_code_cat, generate_stan_code_cont
    added 9 exports
    L, act_fn, chains, iter, load_bnns, nodes, opencl_diagnostics, save_bnns, warmup
  • R
    R 4.6.0 released · 2026-04-24
  • R
    R 4.5.0 released · 2025-04-11
  • 0.1.2
    record
    2025-01-13
  • R
    R 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")
Chatterjee, S. (2026). bnns: Bayesian Neural Network with 'Stan' (Version 1.0.0) [Computer software]. https://doi.org/10.32614/CRAN.package.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.

APA

Balamuta, J. J. (2026). R Observatory: Metrics for bnns version 1.0.0 [Data set]. HJJB, LLC. Data release v2026-10-17. https://doi.org/10.5281/zenodo.21843040

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.

Report a problem with this page →

Privacy choices

These apply to this browser and are stored on this device only. Nothing about your choice is sent to us.

Read the privacy policy