Database Reference
In-Depth Information
Outlook splits as R-L, improve=1.9095430, (0 missing)
Wind < 0.5 to the left, improve=0.5232481, (0 missing)
Node number 3: 7 observations, complexity param=0.3333333
predicted class=yes expected loss=0.1428571 P(node) =0.7
class counts: 1 6
probabilities: 0.143 0.857
left son=6 (1 obs) right son=7 (6 obs)
Primary splits:
Wind < 0.5 to the right, improve=2.8708140, (0 missing)
Outlook splits as RLR, improve=0.6214736, (0 missing)
Temperature splits as LR-, improve=0.3688021, (0 missing)
Humidity splits as RL, improve=0.1674470, (0 missing)
Node number 4: 2 observations
predicted class=no expected loss=0 P(node) =0.2
class counts: 2 0
probabilities: 1.000 0.000
Node number 5: 1 observations
predicted class=yes expected loss=0 P(node) =0.1
class counts: 0 1
probabilities: 0.000 1.000
Node number 6: 1 observations
predicted class=no expected loss=0 P(node) =0.1
class counts: 1 0
probabilities: 1.000 0.000
Node number 7: 6 observations
predicted class=yes expected loss=0 P(node) =0.6
class counts: 0 6
probabilities: 0.000 1.000
The output produced by the summary is difficult to read and comprehend. The
rpart.plot() function from the rpart.plot package can visually represent
the output in a decision tree. Enter the following command to see the help file of
rpart.plot :
?rpart.plot
Enter the following R code to plot the tree based on the model being built. The
resulting tree is shown in Figure 7.9 . Each node of the tree is labeled as either yes
Search WWH ::




Custom Search