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

Conditional Regression Tree

We can also build a regression tree using party.

model <- ctree(formula=form, data=ds[tr, vars])

model
## 
## Model formula:
## risk_mm ~ rain_today + temp_3pm + temp_9am + cloud_3pm + cloud_9am + 
##     pressure_3pm + pressure_9am + humidity_3pm + humidity_9am + 
##     wind_speed_3pm + wind_speed_9am + wind_dir_3pm + wind_dir_9am + 
##     wind_gust_speed + wind_gust_dir + sunshine + evaporation + 
##     rainfall + max_temp + min_temp
## 
## Fitted party:
## [1] root
## |   [2] rainfall <= 21
## |   |   [3] humidity_3pm <= 81
## |   |   |   [4] humidity_3pm <= 67
## |   |   |   |   [5] wind_gust_speed <= 52
## |   |   |   |   |   [6] humidity_3pm <= 50
## |   |   |   |   |   |   [7] sunshine <= 7.5
## |   |   |   |   |   |   |   [8] pressure_3pm <= 1010.9
## |   |   |   |   |   |   |   |   [9] wind_dir_3pm <= NNE: 5.736 (n=141,...
## |   |   |   |   |   |   |   |   [10] wind_dir_3pm > NNE
## |   |   |   |   |   |   |   |   |   [11] wind_speed_9am <= 17: 2.589 (n ...
## |   |   |   |   |   |   |   |   |   [12] wind_speed_9am > 17: 1.143 (n =...
## |   |   |   |   |   |   |   [13] pressure_3pm > 1010.9
## |   |   |   |   |   |   |   |   [14] pressure_3pm <= 1015
## |   |   |   |   |   |   |   |   |   [15] wind_dir_9am <= NE
## |   |   |   |   |   |   |   |   |   |   [16] humidity_3pm <= 40: 1.557 (...
## |   |   |   |   |   |   |   |   |   |   [17] humidity_3pm > 40: 3.966 (n...
## |   |   |   |   |   |   |   |   |   [18] wind_dir_9am > NE: 0.959 (n=6...
## |   |   |   |   |   |   |   |   [19] pressure_3pm > 1015
## |   |   |   |   |   |   |   |   |   [20] cloud_3pm <= 6
## |   |   |   |   |   |   |   |   |   |   [21] wind_gust_speed <= 41: 0.30...
## |   |   |   |   |   |   |   |   |   |   [22] wind_gust_speed > 41: 0.701...
## |   |   |   |   |   |   |   |   |   [23] cloud_3pm > 6
## |   |   |   |   |   |   |   |   |   |   [24] pressure_3pm <= 1023: 0.890...
## |   |   |   |   |   |   |   |   |   |   [25] pressure_3pm > 1023: 0.123 ...
## |   |   |   |   |   |   [26] sunshine > 7.5
## |   |   |   |   |   |   |   [27] pressure_3pm <= 1009.6
## |   |   |   |   |   |   |   |   [28] humidity_3pm <= 31
## |   |   |   |   |   |   |   |   |   [29] humidity_3pm <= 18
## |   |   |   |   |   |   |   |   |   |   [30] wind_gust_dir <= WSW: 0.046...
## |   |   |   |   |   |   |   |   |   |   [31] wind_gust_dir > WSW: 0.298 ...
## |   |   |   |   |   |   |   |   |   [32] humidity_3pm > 18
## |   |   |   |   |   |   |   |   |   |   [33] wind_dir_9am <= NE: 0.860 (...
## |   |   |   |   |   |   |   |   |   |   [34] wind_dir_9am > NE: 0.275 (n...
## |   |   |   |   |   |   |   |   [35] humidity_3pm > 31
## |   |   |   |   |   |   |   |   |   [36] cloud_3pm <= 3
....


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.