as_tidytree: Get posterior tree draws into 'tbl_tree' format from...

Description Usage Arguments Details Value

View source: R/tidytree-funs.R

Description

Creates a tbl_tree grouped by iteration (iter) and tree id (tree_id). See Details below.

Usage

1
as_tidytree(model, extra_cols, label_digits = 2)

Arguments

model

BART model.

extra_cols

Extra columns to be included.

label_digits

Rounding for labels.

Details

List of potential columns returned:

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

Numeric (mean function) value of leaf

child_left

Integer. Left child of node.

child_right

Integer. Right child of node.

Value

A tibble with required columns for tbl_tree: node, parent, label. And columns iter, tree_id are used to differentiate trees and iterations and are always included. Remaining columns are optional (see details).


bonStats/eatmyshorts documentation built on June 1, 2020, 5:42 p.m.