Question 96
A decision tree parent node S has 10 samples (5 positive, 5 negative, Entropy H(S) = 1.0). A split on feature A creates left child S1 (4 positive, 0 negative) and right child S2 (1 positive, 5 negative). What is the Information Gain IG(S, A)? (Round to 2 decimal places)
Original solution basis:
H(S1) = 0 (pure). S2 has 1 pos, 5 neg (n=6): p+=1/6, p-=5/6 => H(S2) = -(1/6)log2(1/6) - (5/6)log2(5/6) = 0.65 bit. Weighted child entropy = (4/10)*0 + (6/10)*0.65 = 0.39. IG = 1.0 - 0.39 = 0.61.
Deep Dive
The parent entropy is 1 bit. The left child is pure (4 positive, 0 negative), so H(S₁)=0. The right child has proportions 1/6 and 5/6, giving H(S₂)=-(1/6)log₂(1/6)-(5/6)log₂(5/6)$\approx 0.650$. Weighted child entropy=(4/10)(0)+(6/10)(0.650)$\approx 0.390$. Information Gain=1.000-0.390$\approx 0.610 bit, so$ the answer is 0.61.
Key Points to Remember:
• Weight child entropy by child size: 4/10 and 6/10.
• The pure left child has entropy zero.
• IG = parent entropy - weighted child entropy $\approx 0.61 bit$.
Exam tip:
Keep full precision during intermediate calculations and round only at the final step, as requested.