Reputation: 59
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.
Upvotes: 0
Views: 1814
Reputation: 1314
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
Upvotes: 0
Reputation: 459
CRAN package party
offers a method called prettyTree
.
Look here
Upvotes: 0