dtree_from_randomForest: Extract a dtree from a randomForest object

Description Usage Arguments Details Examples

Description

Create a dtree object from a tree from a randomForest object

Usage

1

Arguments

rf

A randomForest object

kthTree

Integer specifying which tree to extract from rf

Details

Returns a dtree object

Examples

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")

ben519/btree documentation built on May 12, 2019, 10:56 a.m.