Skip to Content
Practical Predictive Analytics
book

Practical Predictive Analytics

by Ralph Winters
June 2017
Beginner to intermediate
576 pages
15h 22m
English
Packt Publishing
Content preview from Practical Predictive Analytics

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 ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Data Superstream: Analytics Engineering

Data Superstream: Analytics Engineering

Alistair Croll, Anna Filippova, Emilie Schario, Lewis Davies, Jacob Frackson, Benn Stancil, Nick Acosta, Elizabeth Caley
R: Predictive Analysis

R: Predictive Analysis

Tony Fischetti, Eric Mayor, Rui Miguel Forte
Python: Advanced Predictive Analytics

Python: Advanced Predictive Analytics

Ashish Kumar, Joseph Babcock

Publisher Resources

ISBN: 9781785886188Supplemental Content