Game Development Reference
To decide which attribute splits the eat decision, we look for examples where
an attribute's value definitively determines if Eat is yes or no. In this case,
when Food equals Rock, every instance of Eat is no. This means that we could
confidently write a Boolean expression such as
if food = rock
then eat = no
without having to consider any of the other attributes. The total number of
exclusive 0s counted in a column determines the attribute with the best split. By
exclusive we mean that the value of the attribute must be 0 in one column and
greater than 0 in another. If both columns were 0, then the value would have no
effect at all over the decision. In the cases of Rock, Grass, and Cow, the final value
for Eat is already known and thus these values can be used to create instant leaf
nodes off the root node as shown in Figure 5.13 . However, in the case of Tree, the
decision is unclear, as sometimes Eat is yes and sometimes it is no.
To find the next best splitting attribute, outcome decisions involving the Tree
value are combined with the remaining attributes to give the values shown
in Table 5.4 .
In this case, the second best attribute is Hungry. Hungry can now be added to
the decision tree under the Tree node to give the graph shown in Figure 5.14 .
Note that the yes and no choices for Hungry provide definitive answers for Eat,
and therefore the nodes do not need to be classified further with any other
attributes. The decision tree in Figure 5.14 is the complete decision tree for data
from Table 5.2 . You could say in this case that the taste of the food is irrelevant.
FIG 5.13 Partial decision tree for data
from Table 5.3 .