A Database has four transactions. Let minimum support and confidence be 50%.


-->
A Database has four transactions. Let minimum support and confidence be 50%.
Tid
Items bought
1
A,B,D
2
A,D
3
A,C
4
B,D,E,F
 Find out the frequent item sets and strong association rules for the above example using Apriori Algorithm.
Ans.
Step 1: Scan for support count of each candidate –{A,B,C,D,E,F}
C1=
Item
Support
A
¾ =75%
B
2/4=50%
C
¼=25%
D
¾=75%
E
¼=25%
F
¼=25%
Step 2: Comparing with the min support threshold count of 50%.
 L1=
Item
Support
A
3
B
2
D
3
Step 3: Generate candidate C2 from L1.
C2:
Item
{A,B}
{A,D}
{B,D}
Step 4:
Scan for support count of each candidate in C2.
Item
Support
{A,B}
¼=25%
{A,D}
2/4=50%
{B,D}
¼=25%
Step 5:
Compare C2 with minimum support
L2=
Items
Support
{A,D}
2
Step 6: Data contains frequent item {A,D}
Therefore the association rule that can be generated from L are:
Association Rule
Support
Confidence
A->D
2
2/3 = 66%
D->A
2
2/2=100%
As minimum confidence threshold is 50%, then both the rules are output as showing the confidence above 50%.
The rules are:
Rule 1: A->D
Rule 2: D->A

0 comments:

Feel free to contact the admin for any suggestions and help.