Professional Documents
Culture Documents
Association Rules
Association Rules
Apriori algorithm is a kind of frequent itemset algorithm that can be used to mine association rules. This
algorithm firstly finds out all frequent itemsets (i.e. frequency) according to support degree and then
generates association rules (i.e. intensity) according to confidence coefficient.
https://www.youtube.com/watch?v=43CMKRHdH30
Reference: https://www.youtube.com/watch?v=43CMKRHdH30
1
Association Rules Example 1 Solution:
Transaction List
1 Milk Egg Bread Butter
2 Milk Butter Egg Ketchup
3 Bread Butter Ketchup
4 Milk Bread Butter
5 Bread Butter Cookies
6 Milk Bread Butter Cookies
7 Milk Cookies
8 Milk Bread Butter
9 Bread Butter Egg Cookies
10 Milk Butter Bread
11 Milk Bread Butter
12 Milk Bread Cookies Ketchup
No of transactions 100% 12
Minimum No. to support 30% 4
Confidence level 60% 8
For every Non Empty Set S of I, the association rule is defined as follows:
S (I-S)
If Support(I)/Support(S) >= min_confidence
3
Association Rules (Numerical) Example 2:
Consider the following transactions. Apply the association rule mining to get the association rules
with minimum support of 2 and minimum confidence of 50%.
Reference: https://www.youtube.com/watch?v=NT6beZBYbmU
4
Association Rules (Numerical) Example 2 Solution:
In addition to the given transactions’ list above, we can be say:
No of transactions 100% 9
Min No. to support 22% 2
Confidence level 50% 5
We first define association rules for Frequent Item set I = {I1, I2, I3}, then we define association
rules for Frequent Item set I = {I1, I2, I5}
5
First NonEmptySets: {{I1}, {I2}, {I3}, {I1, I2}, {I1, I3}, {I2, I3}}
For every NonEmptySet S of I, the association rule is defined as follows:
S --> (I-S) & If Support(I)/Support(S) >= min_confidence
Rule 1: {I1} --> {I2, I3}
Support = 2/9=22.22%, Confidence = Support (I1, I2, I3)/Support (I1) = (2/9)/(9/9)=2/9=33.33% < 50%
{S=22.22%, C=33.34%} Invalid Rule
Rule 2: {I2} --> {I1, I3}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I2) = 2/7 = 28.57% < 50%
{S=22.22%, C=28.75%} Invalid Rule
Rule 3: {I3} --> {I1, I2}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support(I3) =2/6=33.34% < 50%
{S=22.22%, C=33.34%} Invalid Rule
Rule 4: {I1, I2} --> {I3}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I1, I2) = 2/4 = 50% >= 50%
{S=22.22%, C=50%} Valid Rule
Rule 5: {I1, I3} --> {I2}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I1, I3) = 2/4 = 50% >= 50%
{S=22.22%, C=50%} Valid Rule
Rule 6: {I2, I3} --> {I1}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I2, I3) = 2/4 = 50% >= 50%
{S=22.22%, C=50%} Valid Rule
First NonEmptySets: {{I1}, {I2}, {I3}, {I1, I2}, {I1, I3}, {I2, I3}}
Rule 4: {I1, I2} --> {I3}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I1, I2) = 2/4 = 50% >= 50%
{S=22.22%, C=50%} Valid Rule
Rule 5: {I1, I3} --> {I2}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I1, I3) = 2/4 = 50% >= 50%
{S=22.22%, C=50%} Valid Rule
Rule 6: {I2, I3} --> {I1}
Support = 2/9=22.22%, Confidence=Support (I1, I2, I3)/Support (I2, I3) = 2/4 = 50% >= 50%
{S=22.22%, C=50%} Valid Rule