0% found this document useful (0 votes)
58 views6 pages

Decision Tree

The document contains weather data over 14 days including outlook, temperature, humidity, wind, and whether it would be a good day to play. It analyzes the data using decision trees with Gini splitting and calculates the Gini index as 0.392.

Uploaded by

shubh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
58 views6 pages

Decision Tree

The document contains weather data over 14 days including outlook, temperature, humidity, wind, and whether it would be a good day to play. It analyzes the data using decision trees with Gini splitting and calculates the Gini index as 0.392.

Uploaded by

shubh
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as XLSX, PDF, TXT or read online on Scribd
You are on page 1/ 6

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 Outlook
10 Rain Mild Normal Weak Yes Sunny
11 Sunny Mild Normal Strong Yes Overcast
12 Overcast Mild High Strong Yes Rain
13 Overcast Hot Normal Weak Yes Temperature
14 Rain Mild High Strong No Hot
Mild
Yes Count (p) = 9 Cool
No Count (n) = 5 Humidity
Total rows = 14 High
Normal
Wind
Strong
Weak

Day Outlook Temperature Humidity Wind Play Sunny-Temp


1 Sunny Hot High Weak No Hot
2 Sunny Hot High Strong No Mild
8 Sunny Mild High Weak No Cool
9 Sunny Cool Normal Weak Yes Sunny-Humd
11 Sunny Mild Normal Strong Yes High
Normal
Sunny-Wind
Strong
Weak

Day Outlook Temperature Humidity Wind Play


3 Overcast Hot High Weak Yes
7 Overcast Cool Normal Strong Yes
12 Overcast Mild High Strong Yes
13 Overcast Hot Normal Weak Yes

Day Outlook Temperature Humidity Wind Play Rain-Temp


4 Rain Mild High Weak Yes Mild
5 Rain Cool Normal Weak Yes Cool
6 Rain Cool Normal Strong No Rain-Humd.
10 Rain Mild Normal Weak Yes High
14 Rain Mild High Strong No Normal
Rain-Wind
Strong
Weak

Gini Index

Total
Gini Index
gini = 0.392

Rows Outlook Temperature Humidity Wind Play


1 Sunny Mild Normal Weak Yes
2 Rain Hot High Strong No
p n p + n Information Gain I(p,n) Entropy Gain
9 5 14 0.940285958670631
0.69354 0.24675
2 3 5 0.970950594454668
4 0 4 0
3 2 5 0.970950594454668
0.91106 0.02922
2 2 4 1
4 2 6 0.91829583405449
3 1 4 0.811278124459133
0.78845 0.15184
3 4 7 0.985228136034252
6 1 7 0.591672778582328
0.89216 0.04813
3 3 6 1
6 2 8 0.811278124459133

p n p + n Information Gain I(p,n) Entropy Gain


0.14286 0.79743
0 2 2 0
1 1 2 1
1 0 1 0
0 0.94029
0 3 3 0
2 0 2 0
0.33963 0.60065
1 1 2 1
1 2 3 0.91829583405449

p n p + n Information Gain I(p,n) Entropy Gain


0.33963 0.60065
2 13 0.91829583405449
1 12 1
0.33963 0.60065
1 12 1
2 13 0.91829583405449
0 0.94029
0 22 0
3 03 0

243

89

332
0.39242
gini = 0.392
Algo / Split Tree
Description
Criterion Type
Gini Split / Gini Favours larger partitions. Very
CART
Index simple to implement.
Favours partitions that have
Information Gain /  ID3 /
small counts but many distinct
Entropy C4.5
values.

Classification & Regression Trees (CART)


·       Favours larger partitions.
·       Uses squared proportion of classes.
·       Perfectly classified, Gini Index would be zero.

You might also like