21.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.15125826      0 1.0000000 1.0000000 0.005486734
## 2 0.03314622      1 0.8487417 0.8484744 0.005155757
## 3 0.01000000      3 0.7824493 0.7829075 0.004994256
## 
## Variable importance
##    humidity_3pm        temp_3pm        sunshine wind_gust_speed        max_temp 
##              78               4               4               3               3 
##       cloud_3pm  wind_speed_3pm  wind_speed_9am    humidity_9am        rainfall 
##               2               1               1               1               1 
## 
## Node number 1: 123722 observations,    complexity param=0.1512583
##   predicted class=No   expected loss=0.21166  P(node) =1
##     class counts: 97535 26187
##    probabilities: 0.788 0.212 
##   left son=2 (104265 obs) right son=3 (19457 obs)
##   Primary splits:
##       humidity_3pm < 71.5    to the left,  improve=7027.967, (0 missing)
##       rainfall     < 0.75    to the left,  improve=4082.541, (0 missing)
##       rain_today   splits as  LR,          improve=4032.891, (0 missing)
##       cloud_3pm    < 6.5     to the left,  improve=2898.304, (0 missing)
##       sunshine     < 6.05    to the right, improve=2587.156, (0 missing)
##   Surrogate splits:
##       sunshine  < 0.55    to the right, agree=0.851, adj=0.055, (0 split)
##       temp_3pm  < 10.45   to the right, agree=0.851, adj=0.054, (0 split)
##       max_temp  < 10.55   to the right, agree=0.848, adj=0.031, (0 split)
##       cloud_3pm < 7.5     to the left,  agree=0.846, adj=0.024, (0 split)
##       rainfall  < 30.5    to the left,  agree=0.845, adj=0.014, (0 split)
## 
## Node number 2: 104265 observations
##   predicted class=No   expected loss=0.1388577  P(node) =0.8427361
##     class counts: 89787 14478
##    probabilities: 0.861 0.139 
## 
## Node number 3: 19457 observations,    complexity param=0.03314622
##   predicted class=Yes  expected loss=0.3982114  P(node) =0.1572639
##     class counts:  7748 11709
##    probabilities: 0.398 0.602 
##   left son=6 (11430 obs) right son=7 (8027 obs)
##   Primary splits:
##       humidity_3pm    < 83.5    to the left,  improve=956.1460, (0 missing)
##       rainfall        < 2.05    to the left,  improve=588.9677, (0 missing)
##       rain_today      splits as  LR,          improve=577.5036, (0 missing)
##       wind_gust_speed < 42      to the left,  improve=414.7339, (0 missing)
##       pressure_3pm    < 1011.65 to the right, improve=384.5319, (0 missing)
##   Surrogate splits:
##       humidity_9am < 93.5    to the left,  agree=0.629, adj=0.100, (0 split)
##       cloud_3pm    < 7.5     to the left,  agree=0.622, adj=0.084, (0 split)
##       temp_3pm     < 10.25   to the right, agree=0.622, adj=0.083, (0 split)
##       max_temp     < 11.15   to the right, agree=0.614, adj=0.064, (0 split)
##       sunshine     < 0.95    to the right, agree=0.614, adj=0.064, (0 split)
## 
## Node number 6: 11430 observations,    complexity param=0.03314622
##   predicted class=No   expected loss=0.4704287  P(node) =0.09238454
##     class counts:  6053  5377
##    probabilities: 0.530 0.470 
##   left son=12 (6840 obs) right son=13 (4590 obs)
##   Primary splits:
##       wind_gust_speed < 42      to the left,  improve=322.7057, (0 missing)
##       rainfall        < 2.5     to the left,  improve=305.8717, (0 missing)
##       rain_today      splits as  LR,          improve=302.0296, (0 missing)
##       pressure_9am    < 1013.35 to the right, improve=243.3065, (0 missing)
##       pressure_3pm    < 1013.85 to the right, improve=243.0755, (0 missing)
##   Surrogate splits:
##       wind_speed_3pm < 23      to the left,  agree=0.760, adj=0.402, (0 split)
##       wind_speed_9am < 18      to the left,  agree=0.745, adj=0.364, (0 split)
##       pressure_9am   < 1011.65 to the right, agree=0.646, adj=0.118, (0 split)
##       pressure_3pm   < 1011.55 to the right, agree=0.633, adj=0.085, (0 split)
##       humidity_9am   < 67.5    to the right, agree=0.616, adj=0.043, (0 split)
## 
## Node number 7: 8027 observations
##   predicted class=Yes  expected loss=0.2111623  P(node) =0.06487933
##     class counts:  1695  6332
##    probabilities: 0.211 0.789 
## 
## Node number 12: 6840 observations
##   predicted class=No   expected loss=0.3730994  P(node) =0.05528524
##     class counts:  4288  2552
##    probabilities: 0.627 0.373 
## 
## Node number 13: 4590 observations
##   predicted class=Yes  expected loss=0.3845316  P(node) =0.0370993
##     class counts:  1765  2825
##    probabilities: 0.385 0.615

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.