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

Printing a text version of the decision tree

Printing the rpart object will also give you the text output, which will show you the members of each class after each split point. Entries with an asterisk ( * ) are terminal nodes. Terminal nodes cannot be split any further. Often, segmentation can be performed based on terminal nodes only, assuming the sizes are large enough to make decisions made upon them actionable:

> print(y1)

This print() function sends this output to the console:

 n= 50 node), split, n, deviance, yval * denotes terminal node 1) root 50 88.2990000 70.87860 2) state.abb=AK,AL,AR,AZ,DE,FL,GA,IL,IN,KY,LA,MD,ME,MI,MO,MS,MT,NC,NJ,NM,NV,NY,OH,PA,SC,TN,TX,VA,WV,WY 30 21.0890000 69.98000 4) state.abb=AK,AL,GA,LA,MS,NC,NV,SC,WV ...

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