Database Reference
In-Depth Information
The output includes a summary of every node in the constructed decision tree. If
a node is a leaf, the output includes both the predicted class label ( yes or no for
Play ) and the class probabilities— P( Play ) . The leaf nodes include node numbers
4, 5, 6, and 7. If a node is internal, the output in addition displays the number of
observations that lead to each child node and the improvement that each attribute
may bring for the next split. These internal nodes include numbers 1, 2, and 3.
summary(fit)
Call:
rpart(formula = Play ˜ Outlook + Temperature + Humidity +
Wind,
data = play_decision, method = "class",
parms = list(split = "information"),
control = rpart.control(minsplit = 1))
n= 10
CP nsplit rel error xerror xstd
1 0.3333333 0 1 1.000000 0.4830459
2 0.0100000 3 0 1.666667 0.5270463
Variable importance
Wind Outlook Temperature
51 29 20
Node number 1: 10 observations, complexity param=0.3333333
predicted class=yes expected loss=0.3 P(node) =1
class counts: 3 7
probabilities: 0.300 0.700
left son=2 (3 obs) right son=3 (7 obs)
Primary splits:
Temperature splits as RRL, improve=1.3282860, (0 missing)
Wind < 0.5 to the right, improve=1.3282860, (0 missing)
Outlook splits as RLL, improve=0.8161371, (0 missing)
Humidity splits as LR, improve=0.6326870, (0 missing)
Surrogate splits:
Wind < 0.5 to the right, agree=0.8, adj=0.333, (0 split)
Node number 2: 3 observations, complexity param=0.3333333
predicted class=no expected loss=0.3333333 P(node) =0.3
class counts: 2 1
probabilities: 0.667 0.333
left son=4 (2 obs) right son=5 (1 obs)
Primary splits:
Search WWH ::




Custom Search