O'Reilly logo

Practical Predictive Analytics by Ralph Winters

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Plot the tree

It is much easier to look at a visual representation of a tree. So you will need to install rpart.plot (if you haven't already) so that you are able to view it.

We can see that the first rule corresponds to the primary rule (splitting on Gender), which was generated by the OneR package earlier in this chapter.

devtools::install_github("cran/rpart.plot") library(rpart.plot) rpart.plot(fit,cex=.75) 

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required