Learn R Programming

tidytreatment (version 0.3.1)

posterior_trees_BART: Get posterior tree draws into tibble format from BART model

Description

Tibble grouped by iteration (`iter`) and tree id (`tree_id`). All information calculated by method is included in output.

Usage

posterior_trees_BART(model, label_digits = 2)

Value

A tibble with columns to

iter

Integer describing unique MCMC iteration.

tree_id

Integer. Unique tree id with each `iter`.

node

Integer describing node in tree. Unique to each `tree`-`iter`.

parent

Integer describing parent node in tree.

label

Label for the node.

tier

Position in tree hierarchy.

var

Variable for split.

cut

Numeric. Value of decision rule for `var`.

is_leaf

Logical. `TRUE` if leaf, `FALSE` if stem.

leaf_value

child_left

Integer. Left child of node.

child_right

Integer. Right child of node.

Arguments

model

BART model.

label_digits

Rounding for labels.