20.18 Summary of the Model

summary(model)
## Call:
## rpart(formula = form, data = ds[tr, vars], model = TRUE)
##   n= 139059 
## 
##           CP nsplit rel error    xerror        xstd
## 1 0.16961697      0 1.0000000 1.0000000 0.005188100
## 2 0.02305672      1 0.8303830 0.8319520 0.004837202
## 3 0.01000000      3 0.7842696 0.7852928 0.004727551
## 
## Variable importance
##    humidity_3pm        temp_3pm        sunshine wind_gust_speed        max_temp 
##              80               4               3               3               2 
##        rainfall    humidity_9am  wind_speed_3pm       cloud_3pm  wind_speed_9am 
##               2               1               1               1               1 
##      rain_today 
##               1 
## 
## Node number 1: 139059 observations,    complexity param=0.169617
##   predicted class=No   expected loss=0.2108386  P(node) =1
##     class counts: 109740 29319
##    probabilities: 0.789 0.211 
##   left son=2 (119480 obs) right son=3 (19579 obs)
##   Primary splits:
##       humidity_3pm < 73.5    to the left,  improve=7893.044, (0 missing)
##       rainfall     < 0.55    to the left,  improve=4570.185, (0 missing)
##       rain_today   splits as  LR,          improve=4511.152, (0 missing)
##       cloud_3pm    < 6.5     to the left,  improve=3252.507, (0 missing)
##       sunshine     < 6.15    to the right, improve=2791.328, (0 missing)
##   Surrogate splits:
##       sunshine < 0.45    to the right, agree=0.866, adj=0.048, (0 split)
##       temp_3pm < 9.35    to the right, agree=0.866, adj=0.046, (0 split)
##       max_temp < 10.45   to the right, agree=0.863, adj=0.028, (0 split)
##       rainfall < 34.7    to the left,  agree=0.861, adj=0.014, (0 split)
##       temp_9am < -0.65   to the right, agree=0.860, adj=0.006, (0 split)
## 
## Node number 2: 119480 observations
##   predicted class=No   expected loss=0.1426431  P(node) =0.8592036
##     class counts: 102437 17043
##    probabilities: 0.857 0.143 
## 
## Node number 3: 19579 observations,    complexity param=0.02305672
##   predicted class=Yes  expected loss=0.3730017  P(node) =0.1407964
##     class counts:  7303 12276
##    probabilities: 0.373 0.627 
##   left son=6 (10234 obs) right son=7 (9345 obs)
##   Primary splits:
##       humidity_3pm    < 83.5    to the left,  improve=848.6727, (0 missing)
##       rainfall        < 2.15    to the left,  improve=567.0209, (0 missing)
##       rain_today      splits as  LR,          improve=558.7348, (0 missing)
##       wind_gust_speed < 42      to the left,  improve=378.4575, (0 missing)
##       pressure_3pm    < 1013.85 to the right, improve=364.1613, (0 missing)
##   Surrogate splits:
##       humidity_9am < 90.5    to the left,  agree=0.603, adj=0.168, (0 split)
##       cloud_3pm    < 7.5     to the left,  agree=0.586, adj=0.133, (0 split)
##       temp_3pm     < 12.55   to the right, agree=0.580, adj=0.121, (0 split)
##       rainfall     < 2.35    to the left,  agree=0.572, adj=0.104, (0 split)
##       rain_today   splits as  LR,          agree=0.568, adj=0.095, (0 split)
## 
## Node number 6: 10234 observations,    complexity param=0.02305672
##   predicted class=No   expected loss=0.4863201  P(node) =0.07359466
##     class counts:  5257  4977
##    probabilities: 0.514 0.486 
##   left son=12 (6064 obs) right son=13 (4170 obs)
##   Primary splits:
##       wind_gust_speed < 42      to the left,  improve=284.6792, (0 missing)
##       rainfall        < 1.3     to the left,  improve=265.7632, (0 missing)
##       rain_today      splits as  LR,          improve=259.6638, (0 missing)
##       pressure_9am    < 1017.65 to the right, improve=219.4224, (0 missing)
##       pressure_3pm    < 1013.85 to the right, improve=215.3875, (0 missing)
##   Surrogate splits:
##       wind_speed_3pm < 21      to the left,  agree=0.762, adj=0.417, (0 split)
##       wind_speed_9am < 18      to the left,  agree=0.743, adj=0.370, (0 split)
##       pressure_9am   < 1013.45 to the right, agree=0.645, adj=0.130, (0 split)
##       pressure_3pm   < 1011.55 to the right, agree=0.631, adj=0.095, (0 split)
##       humidity_9am   < 72.5    to the right, agree=0.613, adj=0.051, (0 split)
## 
## Node number 7: 9345 observations
##   predicted class=Yes  expected loss=0.2189406  P(node) =0.06720169
##     class counts:  2046  7299
##    probabilities: 0.219 0.781 
## 
## Node number 12: 6064 observations
##   predicted class=No   expected loss=0.3885224  P(node) =0.04360739
##     class counts:  3708  2356
##    probabilities: 0.611 0.389 
## 
## Node number 13: 4170 observations
##   predicted class=Yes  expected loss=0.3714628  P(node) =0.02998727
##     class counts:  1549  2621
##    probabilities: 0.371 0.629

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



Your donation will support ongoing availability 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