Learn R Programming

bartMan

https://doi.org/10.52933/jdssv.v4i1.79

bartMan is an R-package for investigating and visualising Bayesian Additive Regression Tree (BART) model fits. We construct conventional plots to analyze a model’s performance and stability as well as create new tree-based plots to analyze variable importance, interaction, and tree structure. We employ Value Suppressing Uncertainty Palettes (VSUP) to construct heatmaps that display variable importance and interactions jointly using color scale to represent posterior uncertainty. Our visualizations are designed to work with the most popular BART R packages available, namely BART, dbarts, and bartMachine. A practical example of the package in use can be found in our detailed vignette.

Installation

You can install the released version of bartMan from CRAN with:

install.packages("bartMan")

And the development version from GitHub with:

# install.packages("devtools")
devtools::install_github("AlanInglis/bartMan")

You can then load the package with:

library(bartMan)

Copy Link

Version

Install

install.packages('bartMan')

Monthly Downloads

597

Version

0.2.1

License

GPL (>= 2)

Maintainer

Alan Inglis

Last Published

September 18th, 2025

Functions in bartMan (0.2.1)

input_data

input_data
bartDiag

bartDiag
vimpBart

vimpBart
bartRegrDiag

bartRegrDiag
sort_trees_by_depthMax

Sort Trees by Maximum Depth
treeDepth

treeDepth
plotSingleTree

plotSingleTree
plotTrees

Plot Trees with Customisations
treeBarPlot

Plot Frequency of Tree Structures
treeList

Generate a List of Tree Structures from BART Model Output
treeNodes

treeNodes
permVint

permVint
plotProximity

plotProximity
tree_data_example

tree_data_example
getChildren

Generate Child and Parent Node Relationships
getObservations

Get Observations Falling into Each Node
tree_dataframe

Transform tree data into a structured dataframe
viviBartMatrix

viviBartMatrix
vintPlot

vintPlot
viviBart

viviBart
splitDensity

splitDensity
vimpPlot

vimpPlot
terminalFunction

Generate Terminal Node Indicator
localProcedure

localProcedure
train_bivariate

Train range for bivariate scale
viviBartPlot

viviBartPlot
extractTreeData

extractTreeData
ScaleBivariate

Constructor for bivariate scale object
bartClassifDiag

bartClassifDiag
acceptRate

acceptRate
combineDummy

Update Dummy Variable Names
bartReorder

bartReorder
clusterTrees

Cluster Trees by Variable
get_stump_colour_for_legend

Determines the stump color for a legend based on its mean value
mdsBart

mdsBart
permVimp

permVimp
guide_colourfan

Colourfan guide
pal_vsup

Variance suppressing uncertainty palette
print.hideHelper1

print.hideHelper
RangeBivariate

Constructor for bivariate range object
node_depth

Calculate Node Depths in a Tree Data Frame
proximityMatrix

proximityMatrix