tree2indicators: From a tree to indicators (or dummy variables)

tree2indicatorsR Documentation

From a tree to indicators (or dummy variables)

Description

Coerces a given tree structure inheriting from rpart to binary covariates.

Usage

tree2indicators(fit)

Arguments

fit

a tree structure inheriting to the rpart method

Value

a list of indicators defining the leaf nodes of the fitted tree from left to right

Author(s)

Cyprien Mbogning

Examples

fit <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
tree2indicators(fit)

iBST documentation built on Jan. 12, 2023, 5:15 p.m.