20.18 Summary of the Model

summary(model)
## Call:
## rpart(formula = form, data = ds[tr, vars], model = TRUE)
##   n= 123722 
## 
##           CP nsplit rel error    xerror        xstd
## 1 0.16279070      0 1.0000000 1.0000000 0.005498188
## 2 0.02628252      1 0.8372093 0.8437225 0.005154758
## 3 0.01103406      3 0.7846443 0.7888587 0.005019313
## 4 0.01000000      4 0.7736102 0.7880541 0.005017263
## 
## Variable importance
##    humidity_3pm        sunshine        temp_3pm        rainfall        max_temp 
##              78               4               4               4               2 
##      rain_today wind_gust_speed    humidity_9am       cloud_3pm 
##               2               2               1               1 
## 
## Node number 1: 123722 observations,    complexity param=0.1627907
##   predicted class=No   expected loss=0.2109649  P(node) =1
##     class counts: 97621 26101
##    probabilities: 0.789 0.211 
##   left son=2 (105547 obs) right son=3 (18175 obs)
##   Primary splits:
##       humidity_3pm < 72.5    to the left,  improve=7021.018, (0 missing)
##       rainfall     < 0.45    to the left,  improve=4078.692, (0 missing)
##       rain_today   splits as  LR,          improve=4027.134, (0 missing)
##       cloud_3pm    < 6.5     to the left,  improve=2868.950, (0 missing)
##       sunshine     < 6.05    to the right, improve=2648.879, (0 missing)
##   Surrogate splits:
##       sunshine < 0.45    to the right, agree=0.861, adj=0.054, (0 split)
##       temp_3pm < 9.95    to the right, agree=0.860, adj=0.044, (0 split)
##       max_temp < 10.55   to the right, agree=0.857, adj=0.026, (0 split)
##       rainfall < 30.5    to the left,  agree=0.855, adj=0.014, (0 split)
##       temp_9am < -0.55   to the right, agree=0.854, adj=0.007, (0 split)
## 
## Node number 2: 105547 observations
##   predicted class=No   expected loss=0.1410651  P(node) =0.8530981
##     class counts: 90658 14889
##    probabilities: 0.859 0.141 
## 
## Node number 3: 18175 observations,    complexity param=0.02628252
##   predicted class=Yes  expected loss=0.3831087  P(node) =0.1469019
##     class counts:  6963 11212
##    probabilities: 0.383 0.617 
##   left son=6 (10161 obs) right son=7 (8014 obs)
##   Primary splits:
##       humidity_3pm    < 83.5    to the left,  improve=834.4563, (0 missing)
##       rainfall        < 2.25    to the left,  improve=547.7205, (0 missing)
##       rain_today      splits as  LR,          improve=537.8750, (0 missing)
##       wind_gust_speed < 42      to the left,  improve=370.3472, (0 missing)
##       pressure_3pm    < 1012.15 to the right, improve=333.3856, (0 missing)
##   Surrogate splits:
##       humidity_9am < 93.5    to the left,  agree=0.617, adj=0.132, (0 split)
##       cloud_3pm    < 7.5     to the left,  agree=0.605, adj=0.104, (0 split)
##       temp_3pm     < 10.55   to the right, agree=0.601, adj=0.095, (0 split)
##       sunshine     < 0.95    to the right, agree=0.593, adj=0.076, (0 split)
##       max_temp     < 11.25   to the right, agree=0.592, adj=0.075, (0 split)
## 
## Node number 6: 10161 observations,    complexity param=0.02628252
##   predicted class=No   expected loss=0.4823344  P(node) =0.08212767
##     class counts:  5260  4901
##    probabilities: 0.518 0.482 
##   left son=12 (6886 obs) right son=13 (3275 obs)
##   Primary splits:
##       rainfall        < 2.7     to the left,  improve=287.0070, (0 missing)
##       wind_gust_speed < 42      to the left,  improve=282.3802, (0 missing)
##       rain_today      splits as  LR,          improve=278.2783, (0 missing)
##       pressure_9am    < 1013.35 to the right, improve=221.9931, (0 missing)
##       pressure_3pm    < 1012.65 to the right, improve=212.4673, (0 missing)
##   Surrogate splits:
##       rain_today      splits as  LR,          agree=0.896, adj=0.677, (0 split)
##       pressure_9am    < 1006.65 to the right, agree=0.689, adj=0.034, (0 split)
##       pressure_3pm    < 1005.15 to the right, agree=0.685, adj=0.023, (0 split)
##       temp_3pm        < 28.05   to the left,  agree=0.680, adj=0.008, (0 split)
##       wind_gust_speed < 77      to the left,  agree=0.680, adj=0.008, (0 split)
## 
## Node number 7: 8014 observations
##   predicted class=Yes  expected loss=0.2125031  P(node) =0.06477425
##     class counts:  1703  6311
##    probabilities: 0.213 0.787 
## 
## Node number 12: 6886 observations,    complexity param=0.01103406
##   predicted class=No   expected loss=0.4003776  P(node) =0.05565704
##     class counts:  4129  2757
##    probabilities: 0.600 0.400 
##   left son=24 (5118 obs) right son=25 (1768 obs)
##   Primary splits:
##       wind_gust_speed < 47      to the left,  improve=155.98180, (0 missing)
##       pressure_3pm    < 1012.65 to the right, improve=128.70310, (0 missing)
##       pressure_9am    < 1015.45 to the right, improve=119.38520, (0 missing)
##       cloud_3pm       < 6.5     to the left,  improve=118.68430, (0 missing)
##       sunshine        < 7.95    to the right, improve= 71.97008, (0 missing)
##   Surrogate splits:
##       wind_speed_3pm < 29      to the left,  agree=0.820, adj=0.299, (0 split)
##       wind_speed_9am < 23      to the left,  agree=0.804, adj=0.236, (0 split)
##       pressure_9am   < 1008.05 to the right, agree=0.754, adj=0.044, (0 split)
##       pressure_3pm   < 1003.45 to the right, agree=0.752, adj=0.035, (0 split)
##       humidity_9am   < 56.5    to the right, agree=0.748, adj=0.020, (0 split)
## 
## Node number 13: 3275 observations
##   predicted class=Yes  expected loss=0.3453435  P(node) =0.02647064
##     class counts:  1131  2144
##    probabilities: 0.345 0.655 
## 
## Node number 24: 5118 observations
##   predicted class=No   expected loss=0.3378273  P(node) =0.04136694
##     class counts:  3389  1729
##    probabilities: 0.662 0.338 
## 
## Node number 25: 1768 observations
##   predicted class=Yes  expected loss=0.418552  P(node) =0.0142901
##     class counts:   740  1028
##    probabilities: 0.419 0.581

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.