Reputation: 33
For example: Root = [40, 80] Left Node = [28, 42] and Right Node = [30, 20] Using classification rate, i got
40/120 - ((28+42)/120 * 28/(28+42) + (30+20)/120 * 20/(30+20)) = -0.06666667 Am i calculating this right? And is there a general rules say that classification error will be 0? Thank you!
Upvotes: 0
Views: 452
Reputation: 2042
For decision trees, a criteria of Gini
or Entropy
is chosen. This criteria will help you to define which feature helps you most to "separate" classes. I recommend check these concepts.
I'm not sure what are you referring for "classification rate", and how do you calculate it. In this example you exposes, on the left node, you will classify all sample as the class 2. So you are miss classifying 28 samples of the class 1.
You will have 0 errors if the leaf node (the final node), will have perfectly classified the class (all samples are truly one unique class). Note that I recommend you train the model with a data training and check the accuracy with a new test data.
Upvotes: 1