Unit IV Decision Trees
Unit IV Decision Trees
i
N
PˆC i | x , m pmi m
• Node m is pure if pimis 0 or 1 Nm
• Measure of impurity is entropy
K
I m p log p i
m
i
2 m
i 1
j 1 Nm i 1
Information Gain:
• Information gain is the measurement of changes in
entropy after the segmentation of a dataset based on
an attribute.
• It calculates how much information a feature provides
us about a class.
• According to the value of information gain, we split the
node and build the decision tree.
• A decision tree algorithm always tries to maximize the
value of information gain, and a node/attribute having
the highest information gain is split first. It can be
calculated using the below formula:
In regression, the goodness of a split is measured by the mean square error from the estimated value.
Regression Trees
• If at a node, the error is acceptable, that is, Em < θr , then a
leaf node is created and it stores the gm value.
• If the error is not acceptable, data reaching node m is split
further such that the sum of the errors in the branches is
minimum.
• As in classification, at each node, we look for the attribute
(and split threshold for a numeric attribute) that minimizes
the error, and then we continue recursively.
1 if x X mj : x reaches node m and branch j
bmj x
0 otherwise
1 t mj
b x t
r t
2. https://www.youtube.com/watch?v=wefc_36d5mU&t=52s
3. https://www.youtube.com/watch?v=y6VwIcZAUkI&t=113s