I'm using caret package to model the data using rpart package.
library('caret')
data(iris)
formula <- as.formula(Species ~.)
t <- train(formula,iris,method = "rpart",cp=0.002,maxdepth=8)
plot(t)
As a result I get object 't' and I'm trying to plot this object to get tree plot. But the result look like that:
Are there any way to make a tree plot from caret train object?
nicer looking treeplot:
library(rattle)
fancyRpartPlot(t$finalModel)