A
database has four transactions. Let min_sup=60% and min_conf=80%
TID
Date Items bought
100
10/15/2018 {K, A, B, D}
200
10/15/2018
{D, A, C, E, B}
300
10/19/2018 {C, A, B, E}
400
10/22/2018 {B, A, D}
i)
Find all frequent items using Apriori & FP-growth, respectively. Compare
the efficiency of the two meaning process.
ii)
List all of the strong association rules.
Ans) i) Find all frequent items using Apriori
Step1: Count no of
Transactions:4
Step2: In this
step remove all the items that are bought less than 60% from the table
C1
Item |
Support
Count |
{A} |
4 |
{K} |
1 |
{B} |
4 |
{D} |
3 |
{C} |
2 |
{E} |
2 |
Compare and
prune
Item |
Support
Count |
{A} |
4 |
{B} |
4 |
{D} |
3 |
C2
Item
Set |
Support
Count |
{A,B} |
4 |
{A,D} |
3 |
{B,D} |
3 |
Compare and
prune
Item
Set |
Support
Count |
{A,B} |
4 |
{A,D} |
3 |
{B,D} |
3 |
C3
Item
Set |
Support
Count |
{A,B,D} |
3 |
Compare and
prune
Item
Set |
Support
Count |
{A,B,D} |
3 |
According to
above statement A,B & D is generated whose minimum support is 75% .MOST
FREQUENT ITEM SET IS
{A,B,D}
A=>B,
D
A,
B=>D
A,
D=>B
B=>A,
D
B,
D=>A
D=>A,
B
Find
all frequent items using FP-growth:
First we scan the database and
determine the set of frequent items (1-itemsets) and their support
Counts (frequencies):
L={{A:4},{K:1},{B:4},{D:3},{C:2},{E:2}}
Item |
Support
Count |
Node
Link |
{A} |
4 |
|
{B} |
4 |
|
{D} |
3 |
|
{C} |
2 |
|
{E} |
2 |
|
{K} |
1 |
|
Item |
Support
Count |
Node
Link |
{A} |
4 |
|
{B} |
4 |
|
{D} |
3 |
|
ii) List all of the strong association
rules.
A=>B, D
A, B=>D
A, D=>B
B=>A, D
B, D=>A
D=>A, B
--=>A,B,D
No comments:
Post a Comment