Data Mining: Practical Machine Learning Tools and Techniques, Second Edition

(Brent) #1
selects three. In the event of a tie, we choose the rule with the greater coverage,
giving the final rule:

If astigmatism = yes and tear production rate =normal
and spectacle prescription = myope then recommendation = hard
This is indeed one of the rules given for the contact lens problem. But it only
covers three of the four hardrecommendations. So we delete these three from
the set of instances and start again, looking for another rule of the form:

If? then recommendation =hard
Following the same process, we will eventually find that age=youngis the best
choice for the first term. Its coverage is seven; the reason for the seven is that 3
instances have been removed from the original set, leaving 21 instances alto-
gether. The best choice for the second term is astigmatism=yes,selecting 1/3
(actually, this is a tie);tear production rate=normalis the best for the third,
selecting 1/1.

If age =young and astigmatism =yes and
tear production rate =normal then recommendation = hard
This rule actually covers three of the original set of instances, two of which are
covered by the previous rule—but that’s all right because the recommendation
is the same for each rule.
Now that all the hard-lens cases are covered, the next step is to proceed with
the soft-lens ones in just the same way. Finally, rules are generated for the none
case—unless we are seeking a rule set with a default rule, in which case explicit
rules for the final outcome are unnecessary.
What we have just described is the PRISM method for constructing rules. It
generates only correct or “perfect” rules. It measures the success of a rule by the
accuracy formula p/t.Any rule with accuracy less than 100% is “incorrect” in

110 CHAPTER 4| ALGORITHMS: THE BASIC METHODS


Table 4.9 Part of the contact lens data for which astigmatism=yesand tear
production rate=normal.

Age Spectacle Astigmatism Tear production Recommended
prescription rate lenses

young myope yes normal hard
young hypermetrope yes normal hard
pre-presbyopic myope yes normal hard
pre-presbyopic hypermetrope yes normal none
presbyopic myope yes normal hard
presbyopic hypermetrope yes normal none
Free download pdf