getRules.randomForest: parse a decision tree in randomForest into list of path as...

Description Usage Arguments Value Examples

View source: R/getRules.randomForest.R

Description

parse a decision tree in randomForest into list of path as data.frame

Usage

1
getRules.randomForest(forest, k = 1, label.to = NULL)

Arguments

forest

a randomForest object to be parsed

k

an integer. k-th decision tree in forest will be parsed.

label.to

A character.

Value

a list of rules (data.frame), separated by class label of leaf.

Examples

1
2
3
4
5
6
7
8
9
## Not run: 
X <- iris[, 1:(ncol(iris)-1)]
true.y <- iris[, ncol(iris)]

rf.iris <- randomForest(X, true.y, ntree=30)
getRules.randomForest(rf.iris, k=1)
getRules.randomForest(rf.iris, k=1, label.to = "virginica")

## End(Not run)

katokohaku/featureTweakR documentation built on May 17, 2019, 11:17 p.m.