2
$\begingroup$

I learn how to use decision tree in R

library(rpart)
fit <- rpart(Kyphosis ~ Age + Number + Start, data = kyphosis)
asRules(fit)

return,

Rule number: 3 [Kyphosis=present cover=19 (23%) prob=0.58]
   Start< 8.5

 Rule number: 23 [Kyphosis=present cover=7 (9%) prob=0.57]
   Start>=8.5
   Start< 14.5
   Age>=55
   Age< 111

 Rule number: 22 [Kyphosis=absent cover=14 (17%) prob=0.14]
   Start>=8.5
   Start< 14.5
   Age>=55
   Age>=111

 Rule number: 10 [Kyphosis=absent cover=12 (15%) prob=0.00]
   Start>=8.5
   Start< 14.5
   Age< 55

 Rule number: 4 [Kyphosis=absent cover=29 (36%) prob=0.00]
   Start>=8.5
   Start>=14.5

If I want to make a plot of decision tree, I use the following:

library(rattle)
fancyRpartPlot(fit)

return me the following figure which is associated with the rules above. enter image description here

My question is that

what does prob in each rule mean ? I am confused because when the decision of rule number 22 is absent the prob = 0.14.
I think it should be prob = 0.86 since the number indicates how strong of this decision will be absent.

Could anyone clarify on this ?

Thank you

$\endgroup$
1
$\begingroup$

The prob always means how likely the patient is to be present, even if the node itself is going to predict absent. A probability of 0.14 that kyphosis is present corresponds to a probability of 1 - 0.14 = 0.86 that kyphosis is absent.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.