plotSingleTree function

plotSingleTree

plotSingleTree

Plots individual trees.

plotSingleTree(trees, iter = 1, treeNo = 1, plotType = "icicle")

Arguments

  • trees: A data frame created by extractTreeData function
  • iter: The MCMC iteration or chain to plot.
  • treeNo: The tree number to plot.
  • plotType: What type of plot to display. either dendrogram or icicle.

Returns

A plot of an individual tree

Examples

if (requireNamespace("dbarts", quietly = TRUE)) { # Load the dbarts package to access the bart function library(dbarts) # Get Data df <- na.omit(airquality) # Create Simple dbarts Model For Regression: set.seed(1701) dbartModel <- bart(df[2:6], df[, 1], ntree = 5, keeptrees = TRUE, nskip = 10, ndpost = 10 ) # Tree Data trees_data <- extractTreeData(model = dbartModel, data = df) plotSingleTree(trees = trees_data, iter = 1, treeNo = 1) }
  • Maintainer: Alan Inglis
  • License: GPL (>= 2)
  • Last published: 2024-07-24

Useful links