both yesinstances. Again invoking the algorithm on the lower range, now from
64 to 80, produces the graph labeled C (shown dotted to help distinguish it from
the others). The minimum is at 77.5 (0.801 bits), splitting off another no
instance. Graph D has a minimum at 73.5 (0.764 bits), splitting off two yes
instances. Graph E (again dashed, purely to make it more easily visible), for the
temperature range 64 to 72, has a minimum at 70.5 (0.796 bits), which splits
off two nos and a yes. Finally, graph F, for the range 64 to 70, has a minimum
at 66.5 (0.4 bits).
The final discretization of the temperatureattribute is shown in Figure 7.3.
The fact that recursion only ever occurs in the first interval of each split is an
artifact of this example: in general, both the upper and the lower intervals will
have to be split further. Underneath each division is the label of the graph in
Figure 7.2 that is responsible for it, and below that is the actual value of the split
point.
It can be shown theoretically that a cut point that minimizes the informa-
tion value will never occur between two instances of the same class. This leads
to a useful optimization: it is only necessary to consider potential divisions that
separate instances of different classes. Notice that if class labels were assigned to
the intervals based on the majority class in the interval, there would be no guar-
antee that adjacent intervals would receive different labels. You might be
tempted to consider merging intervals with the same majority class (e.g., the
first two intervals of Figure 7.3), but as we will see later (pages 302–304) this is
not a good thing to do in general.
The only problem left to consider is the stopping criterion. In the tempera-
ture example most of the intervals that were identified were “pure” in that all
their instances had the same class, and there is clearly no point in trying to split
such an interval. (Exceptions were the final interval, which we tacitly decided
not to split, and the interval from 70.5 to 73.5.) In general, however, things are
not so straightforward.
300 CHAPTER 7| TRANSFORMATIONS: ENGINEERING THE INPUT AND OUTPUT
64 65 68 69 70 71 72 75 80 81 83 85
yes no yes yes yes no
no
yes
yes
yes
no yes yes no
FEDCBA
66.5 70.5 73.5 77.5 80.5 84
Figure 7.3The result of discretizing the temperatureattribute.