Decision Tree For Class
Decision Tree For Class
Overview
10 AM 9 AM
8 AM
Stall? Accident?
Long
No Yes No Yes
Short Long Medium Long
GINI=1-{(6/10)2+(2/10)2+(1/10)2+(1/10)2} = 0.58
Computation of GINI Index for Surface Treatment
GINI=1-{(3/3)2} = 0
For surface treatment = Yes, there are two instances of Moderate
Surface Finish, three instances of Good Surface Finish, one instance
with No Effect and One instance with Minimal surface finish
GINI=1-{(2/7)2+(3/7)2+(1/7)2+(1/7)2} = 0.694
For coolent = Yes, there are 5 instances and all of them have
produced good surface finish
GINI=1-{(5/5)2} = 0
For Coolent = No, there are two instances which provides Moderate
surface finish, one instance which provides Good surface finish, one
provides Minimal surface finish and another provides No Change in the
surface finish
Gini(Coolent=No)=1-[(2/5)2+(1/5)2+(1/5)2+(1/5)2]=0.72
Weighted Average of Surface Treatment= 0*(5/10)+0.72*(5/10)=0.36
Rotational Coolent(Yes Surface
Exp No Speed /No) Treatment(Yes/No) Surface Finish
1 High Yes Yes Good
2 High No Yes Moderate
3 Slow Yes Yes Good
4 Medium Yes No Good
5 Medium No Yes No Change
6 Medium Yes No Good
7 Slow No No Good
8 Slow No Yes Minimal Effect
9 Slow Yes Yes Good
10 High No Yes Moderate
Computation of GINI Index for Rotational Speed
It has three possible values, three instances of High,
three instances of Medium, and four instances of Slow
For Rotational Speed=High, there are one instance of Good Surface
Finish and Two instances of Moderate Surface Finish
Gini(Rotational Speed=High)=1-[(2/3)2+(1/3)2]=0.444
For Rotational Speed=Medium, there are two instances of Good Surface
Finish and one instance of No Change Surface Finish
Gini(Rotational Speed=Medium)=1-[(2/3)2+(1/3)2]=0.444
For Rotational Speed=Slow, there are three instances of Good Surface
Finish and One instance of Minimal Effect Surface Finish
Gini(Rotational Speed=Slow)=1-[(3/4)2+(1/4)2]=0.375
Weighted Average of Surface Treatment=
0.444*(3/10)+0.444*(3/10)+0.375*(4/10)=0.416
Computation of GINI Index
For Coolent = No and Surface Treatment =Yes, there are two instances of
surfacefinish viz Moderate, one instance of Surface Finish=Minimal and
another instance of No Change
For Coolant = No and Surface Treatment =No, there is only one possible
outcome ie Surface Finish=Good
Rotational Speed is Chosen as the root as it has the lowest GINI index
For Cholent = No and Rotational Speed = High the
outcome is same(Moderate)
Surface
Rotational Treatment Surface
Exp No Speed Coolant(Yes/No) (Yes/No) Finish
2 High No Yes Moderate
10 High No Yes Moderate
For Cholent = No and Rotational Speed = Medium the
outcome is only one(No Change)
Surface
Rotational Coolant Treatment Surface
Exp No Speed (Yes/No) (Yes/No) Finish
5 Medium No Yes No Change
For Coolant = No and Rotational Speed = Slow the
outcome is two one being Good and another Minimal
Effect
Surface
Rotational Coolant Treatment Surface
Exp No Speed (Yes/No) (Yes/No) Finish
7 Slow No No Good
Minimal
8 Slow No Yes Effect
Decision Tree
Coolant
Yes No
Rotational Speed
Surface Finish=Good
RS=Slow RS=High
RS=Medium
Surface Surface
Treatment No Change Finish=Moderate
Yes
No
Minimal Effect
Good