Hi All,
I wanted to generate a representative decision tree plot from a random forest output.
Thus far, I have found a couple of routines: 'reprtee' and one using the 'caret' package.
The reptree routine is as follows:
library(randomForest)
library(reprtree)
model <- randomForest(Species ~ ., data=iris, importance=TRUE, ntree=500, mtry = 2, do.trace=100)
reprtree:::plot.getTree(model)
However, when I use the reptree routine on my own data, the tree is very large. I wondered if anyone knew how to control the depth and complexity of the tree in reptree?
If anyone has alternative methods, that would also be appreciated 