Go to TogaWare.com Home Page. Data Science Desktop Survival Guide
by Graham Williams
Duck Duck Go



CLICK HERE TO VISIT THE UPDATED SURVIVAL GUIDE

Complexity Parameter

We can print a table of optimal prunings based on a complexity parameter using printcp(). The data is actually stored as model$cptable.

printcp(model)
## 
## Classification tree:
## rpart(formula=form, data=ds[tr, vars], model=TRUE)
## 
## Variables actually used in tree construction:
## [1] humidity_3pm    rainfall        wind_gust_speed
## 
## Root node error: 26101/123722=0.21096
## 
## n= 123722 
## 
##         CP nsplit rel error  xerror      xstd
## 1 0.162791      0   1.00000 1.00000 0.0054982
## 2 0.026283      1   0.83721 0.84372 0.0051548
## 3 0.011034      3   0.78464 0.78886 0.0050193
## 4 0.010000      4   0.77361 0.78805 0.0050173


Support further development by purchasing the PDF version of the book.
Other online resources include the GNU/Linux Desktop Survival Guide.
Books available on Amazon include Data Mining with Rattle and Essentials of Data Science.
Popular open source software includes rattle and wajig.
Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 2000-2020 Togaware Pty Ltd. . Creative Commons ShareAlike V4.