ID3 - rks-1
ID3 - rks-1
(Outlook = Sunny Humidity = Normal) (Outlook = Overcast) (Outlook = Rain Wind = Weak)
[See: Tom M. Mitchell, Machine Learning, McGraw-Hill, 1997]
DWM : RKSwain 2
Decision Tree Learning
DWM : RKSwain 3
Decision Tree Learning
DWM : RKSwain 4
Decision Tree for PlayTennis
• Attributes and their values:
– Outlook: Sunny, Overcast, Rain
– Humidity: High, Normal
– Wind: Strong, Weak
– Temperature: Hot, Mild, Cool
DWM : RKSwain 5
Decision Tree Learning
• E(S) = E([9+,5-])
= (-9/14 log2 9/14) + (-5/14 log2 5/14)
= 0.94
DWM : RKSwain 9
Decision Tree Learning:
A Simple Example
DWM : RKSwain 10
Decision Tree Learning:
A Simple Example
• The information gain for Outlook is:
– G(S,Outlook) = E(S) – [5/14 * E(Outlook =sunny) +
4/14 * E(Outlook = overcast) +
5/14 * E(Outlook=rain)]
DWM : RKSwain 13
Decision Tree Learning:
A Simple Example
• G(S,Wind) = 0.048
DWM : RKSwain 14
Decision Tree Learning:
A Simple Example
• Outlook is our winner!
15
Decision Tree Learning:
A Simple Example
• Now that
– we have discovered the root of our decision tree
– we must now recursively find the nodes that
should go below Sunny, Overcast, and Rain.
DWM : RKSwain 16
Decision Tree Learning:
A Simple Example
• G(Outlook=Rain, Humidity)
= 0.971 – [2/5*E(Outlook=Rain ^ Humidity=high) +
3/5*E(Outlook=Rain ^Humidity=normal]
• G(Outlook=Rain, Humidity) = 0.02
• G(Outlook=Rain,Wind)
= 0.971- [3/5*0 + 2/5*0]
• G(Outlook=Rain,Wind) = 0.971
DWM : RKSwain 17
Decision Tree Learning:
A Simple Example
• Now our decision tree looks like:
DWM : RKSwain 18
Decision Tree for PlayTennis
Outlook
No Yes No Yes
19
Decision Tree for PlayTennis
Outlook