Download as xlsx, pdf, or txt
Download as xlsx, pdf, or txt
You are on page 1of 3

SL NO Ball size Ball Color Price Usefull for Play

1 10 Red 5Y
2 1 Red 1Y
3 50 Red 5Y
4 100 Red 5N
5 1000 Red 10 N

Entropy_before 0.970951

Let us consider Ballsize for the entropy computation


Entropy_left 0

Entropy_right 0

We combine the left/right entropies using the number of instances down each branch as weight
factor (3 instances went left, and 2 instances went right), and get the final entropy after the split

Entropy_after 3/5*Entropy_left + 2/5*Entropy_right = 0

Information_Gain = Entropy_before - Entropy_after


0.97-0
0.970951

You can interpret the above calculation as following: by doing the split with
the Ballsize feature, we were able to reduce uncertainty in the sub-tree prediction
outcome by amount of 0.97(measured in bits as units of information).
SL NO Ball size Ball Color Price Usefull for Play
1 10 Red 5Y
2 1 Red 1Y What are the pure regions?
3 50 Red 5Y Building subsets of data based on the class variable
4 100 Red 5N
5 1000 Red 10 N
Which of the below sets are pure regions
SL NO Ball size Ball Color Price
1 10 Red 5
Set1 2 1 Red 1
3 50 Red 5
4 100 Red 5

SL NO Ball size Ball Color Price


1 10 Red 5
Set2 2 1 Red 1
3 50 Red 5

SL NO Ball size Ball Color Price


1 10 Red 5
Set3 2 1 Red 1
3 100 Red 5
4 100 Red 5

SL NO Ball size Ball Color Price


Set4 1 100 Red 5
2 100 Red 5
on the class variable

Usefull for Play


Y
Y
Y
N

Usefull for Play


Y
Y
Y

Usefull for Play


Y
Y
N
N

Usefull for Play


N
N

You might also like