Visualization of BART and BARP using SHAP
Overview
Complex machine learning models are often difficult to interpret. Shapley values serve as a powerful tool to understand and explain why a model makes a particular prediction. This package computes variable contributions using permutation-based Shapley values for Bayesian Additive Regression Trees (BART) and its extension with Post-Stratification (BARP). The permutation-based SHAP method proposed by Strumbel and Kononenko (2014) doi:10.1007/s10115-013-0679-x is grounded in data obtained via MCMC sampling. Similar to the BART model introduced by Chipman, George, and McCulloch (2010) doi:10.1214/09-AOAS285, this package leverages Bayesian posterior samples generated during model estimation, allowing variable contributions to be computed without requiring additional sampling. The BART model is designed to work with the following R packages: 'BART' doi:10.18637/jss.v097.i01, 'bartMachine' doi:10.18637/jss.v070.i04, and 'dbarts' https://CRAN.R-project.org/package=dbarts. For XGBoost and baseline adjustments, the approach by Lundberg et al. (2020) doi:10.1038/s42256-019-0138-9 is also considered. The BARP model proposed by Bisbee (2019) doi:10.1017/S0003055419000480 was implemented with reference to https://github.com/jbisbee1/BARP and is designed to work with modified functions based on that implementation. BARP extends post-stratification by computing variable contributions within each stratum defined by stratifying variables. The resulting Shapley values are visualized through both global and local explanation methods.
Install
Health
ERRORpackage dependenciesr-release-macos-x86_64
Package required but not available: ‘dbarts’ See section ‘The DESCRIPTION file’ in the ‘Writing R Extensions’ manual.
- ERROR12 OK, 1 ERROR2026-05-02
- OK14 OK2026-04-22
- ERROR13 OK, 1 ERROR2026-04-18
- OK14 OK2026-04-06
- ERROR13 OK, 1 ERROR2026-04-04
Show 1 earlier changeHide 1 earlier change
- OK14 OK2026-03-10
Documentation
- Help pages
- 18
- Examples that run
- 11%1 run in a plain check · 8 never run
- Exported functions with examples
- 83%
- Documented parameters
- 100%
- Return-value docs
- 100%
- Help pages citing references
- 28%
Downloads
Repository
1 development-tooling and community-health practice detected across 1 family in the upstream repository
Checks run against github.com/ldongeunl/bartxviz on 2026-10-22.
Dependencies
Installing bartXViz adds 115 packages (62 with compiled code, 100 MB of source tarballs). Heaviest: stringi 11 MB, bartMachineJARs 8.6 MB, ggplot2 6.0 MB.
Code & Tests
Datasets
People & History
Package metadata
- First published
- 2025-04-28
- Total releases
- 6 / 1 yrs
- License
- GPL (>= 2) OSI
- Minimum R
- ≥ 3.5.0
- Bundled data
- 181 KB / 3 files
- Download size
- 233 KB
Cite
Cite this package
Run in R for the authors' preferred citation:
citation("bartXViz")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-25, which the citation names so these numbers can be found later. More on citing and the projects behind them.