4 . 5
M I N I N G A S S O C I AT I O N RU L E S
1 1 5
If humidity
= normal and windy = false then play = yes
4/4
If
humidity
= normal and play = yes then windy = false
4/6
If windy
= false and play = yes then humidity = normal
4/6
If humidity
= normal then windy = false and play = yes
4/7
If windy
= false then humidity = normal and play = yes
4/8
If play
= yes then humidity = normal and windy = false
4/9
If – then humidity
= normal and windy = false and play = yes
4/12
The figures at the right show the number of instances
for which all three con-
ditions are true—that is, the coverage—divided by the number of instances for
which the conditions in the antecedent are true. Interpreted as a fraction, they
represent the proportion of instances on which the rule is correct—that is, its
accuracy. Assuming that the minimum specified accuracy is 100%, only the first
of these rules will make it into the final rule set. The denominators of the frac-
tions are readily obtained by looking up the antecedent expression in Table 4.10
(though some are not shown in the Table). The final rule above has no condi-
tions in the antecedent, and its denominator is the total number of instances in
the dataset.
Table 4.11 shows the final rule set for the weather data, with minimum cov-
erage 2 and minimum accuracy 100%, sorted by coverage. There are 58 rules, 3
with coverage 4, 5 with coverage 3, and 50 with coverage 2. Only 7 have two
conditions in the consequent, and none has more than two. The first rule comes
from the item set described previously. Sometimes several rules arise from the
same item set. For example, rules 9, 10, and 11 all arise from the four-item set
in row 6 of Table 4.10:
temperature
= cool, humidity = normal, windy = false, play = yes
Table 4.10
(continued)
One-item sets
Two-item sets
Three-item sets
Four-item sets
. . .
. . .
. . .
38
humidity
= normal
humidity
= normal
windy
= false (4)
windy
= false
play
= yes (4)
39
humidity
= normal
humidity
= high
play
= yes (6)
windy
= false
play
= no (2)
40
humidity
= high
windy
= true (3)
. . .
. . .
47
windy
= false
play
= no (2)
P088407-Ch004.qxd 4/30/05 11:13 AM Page 115
1 1 6
C H A P T E R 4
|
A LG O R I T H M S : T H E BA S I C M E T H O D S
Table 4.11
Association rules for the weather data.
Association rule
Coverage
Accuracy
1
humidity
= normal windy = false
fi
play
= yes
4
100%
2
temperature
= cool
fi
humidity
= normal
4
100%
3
outlook
= overcast
fi
play
= yes
4
100%
4
temperature
= cool play = yes
fi
humidity
= normal
3
100%
5
outlook
= rainy windy = false
fi
play
= yes
3
100%
6
outlook
= rainy play = yes
fi
windy
= false
3
100%
7
outlook
= sunny humidity = high
fi
play
= no
3
100%
8
outlook
= sunny play = no
fi
humidity
= high
3
100%
9
temperature
= cool windy = false
fi
humidity
= normal
2
100%
play
= yes
10
temperature
= cool humidity = normal windy
fi
play
= yes
2
100%
= false
11
temperature
= cool windy = false play = yes
fi
humidity
= normal
2
100%
12
outlook
= rainy humidity = normal windy
fi
play
= yes
2
100%
= false
13
outlook
= rainy humidity = normal play = yes
fi
windy
= false
2
100%
14
outlook
= rainy temperature = mild windy
fi
play
= yes
2
100%
= false
15
outlook
= rainy temperature = mild play = yes
fi
windy
= false
2
100%
16
temperature
= mild windy = false play = yes
fi
outlook
= rainy
2
100%
17
outlook
= overcast temperature = hot
fi
windy
= false
2
100%
play
= yes
18
outlook
= overcast windy = false
fi
temperature
= hot
2
100%
play
= yes
19
temperature
= hot play = yes
fi
outlook
= overcast
2
100%
windy
= false
20
outlook
= overcast temperature = hot windy
fi
play
= yes
2
100%
= false
21
outlook
= overcast temperature = hot play
fi
windy
= false
2
100%
= yes
22
outlook
= overcast windy = false play = yes
fi
temperature
= hot
2
100%
23
temperature
= hot windy = false play = yes
fi
outlook
= overcast
2
100%
24
windy
= false play = no
fi
outlook
= sunny
2
100%
humidity
= high
25
outlook
= sunny humidity = high windy = false
fi
play
= no
2
100%
26
outlook
= sunny windy = false play = no
fi
humidity
= high
2
100%
27
humidity
= high windy = false play = no
fi
outlook
= sunny
2
100%
28
outlook
= sunny temperature = hot
fi
humidity
= high
2
100%
play
= no
29
temperature
= hot play = no
fi
outlook
= sunny
2
100%
humidity
= high
30
outlook
= sunny temperature = hot humidity
fi
play
= no
2
100%
= high
31
outlook
= sunny temperature = hot play = no
fi
humidity
= high
2
100%
. . .
. . .
. . .
. . .
58
outlook
= sunny temperature = hot
fi
humidity
= high
2
100%
P088407-Ch004.qxd 4/30/05 11:13 AM Page 116