build_model.randomForest: build_model.randomForest

Description Usage Arguments Value Examples

Description

Builds an entire PFA list of lists based on a single randomForest model tree

Usage

1
2
## S3 method for class 'randomForest'
build_model(object, which_tree = 1, ...)

Arguments

object

a object of class randomForest

which_tree

an integer indicating which single tree to build

...

further arguments passed to or from other methods

Value

a list of lists representation of the tree that can be inserted into a cell or pool

Examples

1
2
3
4
5
6
dat <- data.frame(X1 = runif(100), 
                  X2 = rnorm(100))
dat$Y <- factor((rexp(100,5) + 5 * dat$X1 - 4 * dat$X2) > 0)

model <- randomForest::randomForest(Y ~ X1 + X2, data=dat, ntree=10)
my_tree <- build_model(model, 1)

aurelius documentation built on May 2, 2019, 3:43 a.m.