0
votes

I am newbie in R and I need to know how to plot a tree selected from a random forest training model created using the train () function in caret package.

First and foremost, I used a training dataset to create a fitting model of a random forest using the train() function. The created random forest contains about 500 trees. Is there any methodology to create a plot of a selected tree?

Thank you.

2

2 Answers

0
votes

CRAN package party offers a method called prettyTree. Look here

0
votes

As far as I know, the randomForest package does not have any built-in functionality to plot individual trees. You can extract trees using the getTree() function, but nothing is provided to plot / visualize it. This question may be a duplicate as a quick search yielded approaches other people have used to extract trees from a random forest are found here and here and here