3 - Decision Trees
3 - Decision Trees
Decision Trees
Outlook_ Outlook_ Outlook_ Temperature_ Temperature_ Temperature_ Humidity_ Humidity_ Wind_ Wind_
Overcast Rain Sunny Cool Hot Mild High Normal Strong Weak Play
FALSE TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE No
TRUE FALSE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE Yes
FALSE FALSE TRUE FALSE FALSE TRUE TRUE FALSE FALSE TRUE No
FALSE FALSE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE Yes
FALSE TRUE FALSE FALSE FALSE TRUE FALSE TRUE FALSE TRUE Yes
FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE Yes
TRUE FALSE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE Yes
TRUE FALSE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE Yes
FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE No
So, among all the values of computed weighted_GINI, the Weighted_GINI(Outlook_overcast) has a
minimum GINI impurity, therefore it can be selected as a root node.
Outlook_Rain = TRUE
Temperature_ Temperature_ Temperature_ Humidity Humidity Wind_ Wind_
Play
Cool Hot Mild _High _Normal Strong Weak
TRUE FALSE FALSE FALSE TRUE TRUE FALSE No
So here we are having Wind_Weak and Wind_Strong as purest GINIs. With equal purity,
therefore we need to randomly select one out of these. So, here we selected Wind_Strong and
GINI(True)=0 and GINI(False)=0 for Wind_Strong.
Outlook_Rain= FALSE
Outlook_ Outlook_ Temperature_ Temperature_ Temperature_ Humidity Humidity Wind_ Wind_
Play
Overcast Sunny Cool Hot Mild _High _Normal Strong Weak
TRUE FALSE TRUE FALSE FALSE FALSE TRUE TRUE FALSE Yes
FALSE TRUE TRUE FALSE FALSE FALSE TRUE FALSE TRUE Yes
FALSE TRUE FALSE FALSE TRUE FALSE TRUE TRUE FALSE Yes
TRUE FALSE FALSE FALSE TRUE TRUE FALSE TRUE FALSE Yes
TRUE FALSE FALSE TRUE FALSE FALSE TRUE FALSE TRUE Yes
So here we are having Humidity_High and Humidity_Normal as purest GINIs. With equal
purity, therefore we need to randomly select one out of these. So, here we selected
Humidity_Normal and GINI(True)=0 and GINI(False)=0.5 for Humidity_Normal.
Humidity_Normal=False
Outlook_ Outlook_ Temperature_ Temperature_ Temperature_ Humidity Wind_ Wind_
Play
Overcast Sunny Cool Hot Mild _High Strong Weak
FALSE TRUE FALSE FALSE TRUE TRUE FALSE TRUE No
TRUE FALSE FALSE FALSE TRUE TRUE TRUE FALSE Yes
So, here we selected Outlook_Sunny and GINI(True)=0 and GINI(False)=0 for Outlook_Sunny.
FALSE TRUE
Outlook_Rain
FALSE TRUE
Outlook_Sunny Yes Yes No
Yes No