Thanks to visit codestin.com
Credit goes to www.scribd.com

0% found this document useful (0 votes)
30 views2 pages

Decision Tree

Uploaded by

ksimran8800
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)
30 views2 pages

Decision Tree

Uploaded by

ksimran8800
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/ 2

A B C D E Gini Var A

4.8 3.4 1.9 0.2 positive Positive Negative Row total


5 3 1.6 0.2 positive >=5.2 3 7 10
5 3.4 1.6 0.4 positive <5.2 5 1 6
5.2 3.5 1.5 0.2 positive Grand total 16
5.2 3.4 1.4 0.2 positive Probability = Number of events/ total number of events
4.7 3.2 1.6 0.2 positive Gini(3,7) 0.42
4.8 3.1 1.6 0.2 positive Gini(5,1) 0.27777778
5.4 3.4 1.5 0.4 positive Gini Var A 0.36666667
7 3.2 4.7 1.4 negative
6.4 3.2 4.5 1.5 negative Gini Var C
6.9 3.1 4.9 1.5 negative Positive Negative Row total
5.5 2.3 4 1.3 negative >=4.2 0 6 6
6.5 2.8 4.6 1.5 negative <4.2 8 2 10
5.7 2.8 4.5 1.3 negative Grand total 16
6.3 3.3 4.7 1.6 negative
4.9 2.4 3.3 1 negative Gini(0,6) 0
Gini(8,2) 0.32
Gini Var C 0.2

Lowest Gini and highest information gain


calculate for all variables
Entropy & Information Gain of Var A
Positive Negative Row total
>=5.2 3 7 10
<5.2 5 1 6
Grand total 16
Entropy(3,7) 0.8812909
Entropy(5,1) 0.65002242
Entropy Var A 0.79456522

Dependent VaPositive Negative


8 8 16
Entropy(8,8) 1

Information gain of Var A 0.20543478

Entropy & Information Gain of Var C


Positive Negative Row total
>=4.2 0 6 6
<4.2 8 2 10
Grand total 16
Entropy(0,6) 0
Entropy(8,2) 0.72192809
Entropy Var C 0.45120506

Information gain of Var C 0.54879494

You might also like