10.4 rain demo decision tree

Display the Decision Tree

An AI model targets a specific knowledge respresentation langauge. Here the knowledge is represented as a decision tree. We can gain insight into the model through a textual representation of the decision tree as below.

The first line in the description reports the number of observations in the training dataset. The line begining with β€˜node)’ is a legend. Split is a test condition, n is the number of observations that have made there way to this node, the loss is the error in the prediction at this node, the yval the majority class (i.e., the prediction), and yprob is class probability.

n= 123722 

node), split, n, loss, yval, (yprob)
      * denotes terminal node

 1) root 123722 49488.800 no (0.6000000 0.4000000)  
   2) humidity_3pm< 64.5 92796 20592.860 no (0.7514612 0.2485388)  
     4) wind_gust_speed< 51 77929 13536.100 no (0.7989322 0.2010678) *
     5) wind_gust_speed>=51 14867  7056.761 no (0.5457407 0.4542593)  
      10) humidity_3pm< 45.5 8817  2742.284 no (0.6713901 0.3286099) *
      11) humidity_3pm>=45.5 6050  2875.072 yes (0.3998960 0.6001040) *
   3) humidity_3pm>=64.5 30926 11970.350 yes (0.2929151 0.7070849)  
     6) humidity_3pm< 79.5 20058  9709.632 yes (0.4119874 0.5880126)  
      12) rainfall< 1.15 12726  6607.019 no (0.5155528 0.4844472)  
        24) wind_gust_speed< 47 10144  4398.327 no (0.5749978 0.4250022) *
        25) wind_gust_speed>=47 2582  1080.620 yes (0.3285246 0.6714754) *
      13) rainfall>=1.15 7332  2678.388 yes (0.2697397 0.7302603) *
     7) humidity_3pm>=79.5 10868  2260.721 yes (0.1306888 0.8693112) *


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-2022 Graham.Williams@togaware.com Creative Commons Attribution-ShareAlike 4.0