Reputation: 1003
Is there anyway to visualize a random forest output in R? I read a article that talks about the export_graphviz
library in python that uses an output's n_estimators parameter to export the decision tree in a DOT format which then is used to generate a graphical representation of the decision tree.
Do we have anything like this in R?
Upvotes: 2
Views: 3619
Reputation: 2213
Maybe you can consider something like
library(randomForest)
library(reprtree)
model <- randomForest(Species ~ ., data = iris, importance = TRUE, ntree = 500, mtry = 2, do.trace = 100)
reprtree:::plot.getTree(model)
Upvotes: 2