Description Usage Arguments Details Examples
Create a dtree object from a tree from a randomForest object
1 | dtree_from_randomForest(rf, kthTree, data = NULL)
|
rf |
A randomForest object |
kthTree |
Integer specifying which tree to extract from rf |
Returns a dtree object
1 2 3 4 5 6 | library(data.table)
library(randomForest)
library(ggplot2)
rf <- randomForest(mpg ~ cyl + disp + hp, data = mtcars)
dtree <- dtree_from_randomForest(rf, 1L)
plot_btree(dtree, labelCol = "Split")
|
Add the following code to your website.
For more information on customizing the embed code, read Embedding Snippets.