I am in R using the DoctorVisits dataset from the AER package. I chose the column lchronic to make this tree enter image description here

Thing is that I don't understand why the algorithm made the branch freerepat: no seeing as it results in two leaves which are both no. The tree is basically equivalent to this pruned one:enter image description here

  • $\begingroup$ Maybe you could ask the package authors? $\endgroup$ – kjetil b halvorsen Jan 21 at 18:33
  • 1
    $\begingroup$ For rare events, one might expect every leaf of a tree to be a no. Some “no”’s may just be more likely than others. $\endgroup$ – guy Jan 21 at 18:46

Decision trees (generally) choose splits to minimize impurity within the nodes. If a split can change a 75% "no" node into two children with 99% no and 51% no (respectively), then it is reasonably likely to do so, even if the final predicted (majority) class in both children is "no".


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.