Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
71 views

Decision Tree Calculation For Play Example

The document describes a decision tree model for predicting whether to play or not play based on weather conditions including outlook, temperature, humidity, and wind. It analyzes the information gain from each attribute and finds that outlook provides the maximum information gain for making the prediction. Temperature provides the next highest information gain followed by humidity and then wind.

Uploaded by

Parthraj Solanki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
71 views

Decision Tree Calculation For Play Example

The document describes a decision tree model for predicting whether to play or not play based on weather conditions including outlook, temperature, humidity, and wind. It analyzes the information gain from each attribute and finds that outlook provides the maximum information gain for making the prediction. Temperature provides the next highest information gain followed by humidity and then wind.

Uploaded by

Parthraj Solanki
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Decision Tree

Day Outlook Temperature Humidity Wind Play


1 Sunny Hot High Weak No
2 Sunny Hot High Strong No
3 Overcast Hot High Weak Yes
4 Rain mild High Weak Yes
5 Rain Cool Normal Weak Yes
6 Rain Cool Normal Strong No
7 Overcast Cool Normal Strong Yes
8 Sunny Mild High Weak No
9 Sunny Cool Normal Weak Yes
10 Rain Mild Normal Weak Yes
11 Sunny Mild Normal Strong Yes
12 Overcast Mild High Strong Yes
13 Overcast Hot Normal Weak yes
14 Rain Mild High Srong No
Entropy Degree of randomness
• Total 14
• Yes 9
• No 5
• Entropy= -9/14*log(9/14) – 5/14*log(5/14)
• Entropy=0.94028
Information in Outlook- Sunny
• Sunny
Day
• Outloo
k
Tempe Humid Wind
rature ity
Play
Yes 2
1 • Sunny Hot High Weak No No 3
2
• Sunny Hot High Strong No
Entropy = -2/5log(2/5)-3/5log(3/5)
8 Sunny Mild High Weak No
9 • n Sunny Cool Norma Weak Yes Entropy = 0.9709
l
11 Sunny Mild Norma Strong Yes
l
Information in Outlook- Overcast
• Overcast

Day Outlo Tempe Humid Wind Play Yes 4
ok rature ity
•3 Overc Hot High Weak Yes
No 0
• ast
Entropy = -4/4log(1)
7 Overc Cool Norm Strong Yes
• n ast al Entropy = 0
12 Overc Mild High Strong Yes
ast
13 Overc Hot Norm Weak yes
ast al
Information in Outlook- Rainy
• Rainy
Day • Outloo Tempe Humidi Wind Play Yes 3
k rature ty
4 • Rain mild High Weak Yes No 2
5 • Rain Cool Norma Weak Yes Entropy = -2/5log(2/5)-3/5log(3/5)
l
6 • nRain Cool Norma Strong No Entropy = 0.9709
l
10 Rain Mild Norma Weak Yes
l
14 Rain Mild High Srong No
Information Gain in Outlook
• Sunny = 5
• Overcast = 4
• Rainy = 5
• Total 14
• Information = 5/14*0.9709 +4/14*0 +5/14*0.9709
• 0.693536
• Information Gain is
• Total Entropy – Information
• 0.9402 – 0.6935
• 0.2467
Temperature
• Hot • Mild
• Yes 2 • Yes 4 • Cool
• No 2 • No 2 • Yes 3
Day Outl Temp Humi Wind Play • No 1
ook eratu dity
re
Day Outl Tem Hum Win Play Day Outl Tem Hu Win Play
ook pera idity d 4 Rain mild High Weak Yes ook pera midi d
ture 8 Sunn Mild High Weak No ture ty
1 Sunn Hot High Wea No y 5 Rain Cool Nor Wea Yes
y k 10 Rain Mild Norm Weak Yes mal k
2 Sunn Hot High Stro No al 6 Rain Cool Nor Stro No
y ng 11 Sunn Mild Norm Stron Yes mal ng
3 Over Hot High Wea Yes y al g 7 Over Cool Nor Stro Yes
cast k 12 Over Mild High Stron Yes cast mal ng
13 Over Hot Nor Wea yes cast g 9 Sun Cool Nor Wea Yes
cast mal k 14 Rain Mild High Srong No ny mal k
Humidity
• High ( Yes(3), No(4)) Normal (Yes(6), No(1))
• -3/7log3/7-4/7log4/7 -6/7log6/7-1/7log1/7

Day Outlo Temp Humi Wind Play


ok eratur dity
e
1 Sunny Hot High Weak No Day Outlook Temperat Humidity Wind Play
ure
2 Sunny Hot High Strong No
5 Rain Cool Normal Weak Yes
3 Overc Hot High Weak Yes
ast 6 Rain Cool Normal Strong No

4 Rain mild High Weak Yes 7 Overcast Cool Normal Strong Yes

8 Sunny Mild High Weak No 9 Sunny Cool Normal Weak Yes

12 Overc Mild High Strong Yes 10 Rain Mild Normal Weak Yes
ast 11 Sunny Mild Normal Strong Yes
14 Rain Mild High Srong No 13 Overcast Hot Normal Weak yes
Information Gains
• Outlook 0.2467
• Temperature 0.0292
• Humidity 0.1518
• Wind 0.04812703
• Maximum is outlook

You might also like