21.18 Summary of the Model

summary(model)
## Call:
## rpart(formula = form, data = ds[tr, vars], model = TRUE)
##   n= 134001 
## 
##           CP nsplit rel error    xerror        xstd
## 1 0.14425193      0 1.0000000 1.0000000 0.005295391
## 2 0.03958674      1 0.8557481 0.8527657 0.004984930
## 3 0.03376411      2 0.8161613 0.8247888 0.004920008
## 4 0.01000000      3 0.7823972 0.7836754 0.004820819
## 
## Variable importance
## humidity_3pm     temp_3pm     sunshine     rainfall     max_temp   rain_today 
##           78            5            4            4            3            2 
##    cloud_3pm humidity_9am 
##            2            1 
## 
## Node number 1: 134001 observations,    complexity param=0.1442519
##   predicted class=No   expected loss=0.2101925  P(node) =1
##     class counts: 105835 28166
##    probabilities: 0.790 0.210 
##   left son=2 (112640 obs) right son=3 (21361 obs)
##   Primary splits:
##       humidity_3pm < 71.5    to the left,  improve=7529.863, (0 missing)
##       rainfall     < 0.75    to the left,  improve=4453.646, (0 missing)
##       rain_today   splits as  LR,          improve=4407.422, (0 missing)
##       cloud_3pm    < 6.5     to the left,  improve=3043.977, (0 missing)
##       sunshine     < 6.05    to the right, improve=2701.205, (0 missing)
##   Surrogate splits:
##       temp_3pm  < 10.55   to the right, agree=0.849, adj=0.054, (0 split)
##       sunshine  < 0.65    to the right, agree=0.849, adj=0.053, (0 split)
##       max_temp  < 10.65   to the right, agree=0.846, adj=0.031, (0 split)
##       cloud_3pm < 7.5     to the left,  agree=0.844, adj=0.019, (0 split)
##       rainfall  < 34.1    to the left,  agree=0.843, adj=0.015, (0 split)
## 
## Node number 2: 112640 observations
##   predicted class=No   expected loss=0.1371982  P(node) =0.8405907
##     class counts: 97186 15454
##    probabilities: 0.863 0.137 
## 
## Node number 3: 21361 observations,    complexity param=0.03958674
##   predicted class=Yes  expected loss=0.4048968  P(node) =0.1594093
##     class counts:  8649 12712
##    probabilities: 0.405 0.595 
##   left son=6 (11741 obs) right son=7 (9620 obs)
##   Primary splits:
##       humidity_3pm    < 82.5    to the left,  improve=1060.0780, (0 missing)
##       rainfall        < 2.15    to the left,  improve= 716.9402, (0 missing)
##       rain_today      splits as  LR,          improve= 695.4539, (0 missing)
##       wind_gust_speed < 42      to the left,  improve= 456.8448, (0 missing)
##       pressure_3pm    < 1013.75 to the right, improve= 432.3104, (0 missing)
##   Surrogate splits:
##       humidity_9am < 90.5    to the left,  agree=0.614, adj=0.143, (0 split)
##       cloud_3pm    < 7.5     to the left,  agree=0.603, adj=0.119, (0 split)
##       temp_3pm     < 11.85   to the right, agree=0.597, adj=0.104, (0 split)
##       max_temp     < 12.45   to the right, agree=0.584, adj=0.076, (0 split)
##       sunshine     < 0.95    to the right, agree=0.583, adj=0.074, (0 split)
## 
## Node number 6: 11741 observations,    complexity param=0.03376411
##   predicted class=No   expected loss=0.4525168  P(node) =0.08761875
##     class counts:  6428  5313
##    probabilities: 0.547 0.453 
##   left son=12 (7728 obs) right son=13 (4013 obs)
##   Primary splits:
##       rainfall        < 2.05    to the left,  improve=335.9019, (0 missing)
##       rain_today      splits as  LR,          improve=326.1689, (0 missing)
##       wind_gust_speed < 43.5    to the left,  improve=297.4707, (0 missing)
##       pressure_9am    < 1012.75 to the right, improve=254.4018, (0 missing)
##       pressure_3pm    < 1013.75 to the right, improve=247.2227, (0 missing)
##   Surrogate splits:
##       rain_today      splits as  LR,          agree=0.930, adj=0.796, (0 split)
##       pressure_9am    < 1006.65 to the right, agree=0.674, adj=0.045, (0 split)
##       pressure_3pm    < 1003.05 to the right, agree=0.666, adj=0.023, (0 split)
##       temp_3pm        < 28.05   to the left,  agree=0.662, adj=0.010, (0 split)
##       wind_gust_speed < 68      to the left,  agree=0.661, adj=0.008, (0 split)
## 
## Node number 7: 9620 observations
##   predicted class=Yes  expected loss=0.2308732  P(node) =0.07179051
##     class counts:  2221  7399
##    probabilities: 0.231 0.769 
## 
## Node number 12: 7728 observations
##   predicted class=No   expected loss=0.3663302  P(node) =0.05767121
##     class counts:  4897  2831
##    probabilities: 0.634 0.366 
## 
## Node number 13: 4013 observations
##   predicted class=Yes  expected loss=0.3815101  P(node) =0.02994754
##     class counts:  1531  2482
##    probabilities: 0.382 0.618

In the following pages we dissect the various components of this summary.



Your donation will support ongoing development and give you access to the PDF version of this book. Desktop Survival Guides include Data Science, GNU/Linux, and MLHub. Books available on Amazon include Data Mining with Rattle and Essentials of Data Science. Popular open source software includes rattle, wajig, and mlhub. Hosted by Togaware, a pioneer of free and open source software since 1984.
Copyright © 1995-2021 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0.