Description Usage Arguments Value Examples
View source: R/getRules.randomForest.R
parse a decision tree in randomForest into list of path as data.frame
1 | getRules.randomForest(forest, k = 1, label.to = NULL)
|
forest |
a randomForest object to be parsed |
k |
an integer. k-th decision tree in forest will be parsed. |
label.to |
A character. |
a list of rules (data.frame), separated by class label of leaf.
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)
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.