You are on page 1of 6

Question No.

2: [08 Marks]

In ZIMS store the manager is interested in determining which items sell well together. The
manager assigned you this task and you opted for using Apriori Algorithm for finding the
frequent item sets and association rules.

You set the following threshold parameters for given sales transactional database:

Support: 0.4
Confidence: 0.9

The sales transactional database available to you in Table 2.1:

Present your findings to the manager showing detailed workings and outcome of the process.
Table 2.1

Sales ID Items
S1 {O,W,C,N,Z}
S2 {O,C,K,N,Z}
S3 {K,N,W,Z,O}
S4 {K,W,Z,O}
S5 {C,K,N,Z}
S6 {O,K,N}
S7 {O,N,W,Z}
S8 {K,N,Z}
Answer # 2

Support: 0.4 × 100 =


40%
Confidence: 0.9 × 100 =
90%

Means frequency should


be
(40/100) × 8 = 3.2
approximately 4

Item set (k=1) Support (Frequency)


O 6
W 4
C 3
N 7
Z 7
K 6

Anything less than 4 support is rejected

Item set (k=1) Support (Frequency)


O 6
W 4
C 3
N 7
Z 7
K 6
Updated table

Item set (k=1) Support (Frequency)


O 6
W 4
N 7
Z 7
K 6

Combination of 2 are formed (2- item sets)

Item sets (k=2) Support (Frequency)


{O, W} 4
{O, N} 5
{O, Z} 5
{O, K} 4
{W, N} 3
{W, Z} 4
{W, K} 2
{N, Z} 6
{N, K} 5
{Z, K} 5

Anything less than 4 support is rejected

Item sets (k=2) Support (Frequency)


{O, W} 4
{O, N} 5
{O, Z} 5
{O, K} 4
{W, N} 3
{W, Z} 4
{W, K} 2
{N, Z} 6
{N, K} 5
{Z, K} 5
Updated table

Item sets (k=2) Support (Frequency)


{O, W} 4
{O, N} 5
{O, Z} 5
{O, K} 4
{W, Z} 4
{N, Z} 6
{N, K} 5
{Z, K} 5

Combination of 3 are formed (3- item sets)

Item sets (k=3) Support (Frequency)


{O, W, N} 3
{O, W, Z} 4
{O, W, K} 2
{W, N, Z} 3
{W, N, K} 1
{N, Z, K} 3
{O, N, Z} 4
{O, N, K} 3
{W, Z, K} 2
{O, Z, K} 3

Anything less than 4 support is rejected


Item sets (k=3) Support (Frequency)
{O, W, N} 3
{O, W, Z} 4
{O, W, K} 2
{W, N, Z} 3
{W, N, K} 1
{N, Z, K} 3
{O, N, Z} 4
{O, N, K} 3
{W, Z, K} 2
{O, Z, K} 3

Updated table

Item sets (k=3) Support (Frequency)


{O, W, Z} 4
{O, N, Z} 4

Combination of 3 are formed (3- item sets)

Item sets (k=4) Support (Frequency)


{O, W, Z, N} 1

Anything less than 4 support is rejected

Item sets (k=4) Support (Frequency)


{O, W, Z, N} 1

All are rejected


This indicates that we cannot have 4 itemsets, we can only have 3 itemsets (previous iteration
sets)
That is

Item sets (k=3) Support (Frequency)


{O, W, Z} 4
{O, N, Z} 4

Now for the rules

Rules Support Confidence


{O, W} => Z 4/8 × 100 = 50% 4/4 ×100 = 100%
{O, Z} => W 4/8 × 100 = 50% 4/5 × 100 = 80%
{Z, W} => O 4/8 × 100 = 50% 4/4 × 100 = 100%
{O}=> {Z, W} 4/8 × 100 = 50% 4/6 × 100 = 66.666%
{W} => {O, Z} 4/8 × 100 = 50% 4/4 × 100 = 100%
{Z} => {O, W) 4/8 × 100 = 50% 4/7 × 100 = 57.142%
{O, N} => Z 4/8 × 100 = 50% 4/5 × 100 = 80%
{O, Z} => N 4/8 × 100 = 50% 4/5 × 100 = 80%
{Z, N} => O 4/8 × 100 = 50% 4/6 × 100 = 66.666%
{O} => {Z, N} 4/8 × 100 = 50% 4/6 × 100 = 66.666%
{N} => {O, Z} 4/8 × 100 = 50% 4/7 × 100 = 57.142%
{Z} => {O, N} 4/8 × 100 = 50% 4/7 × 100 = 57.142%

THE FOLLOWING ITEM SETS MEET THE REQUIREMENT OF SUPPORT OF 40% AND
CONFIDENCE OF 90%

Rules Support Confidence


{O, W} => Z 4/8 × 100 = 50% 4/4 ×100 = 100%
{Z, W} => O 4/8 × 100 = 50% 4/4 × 100 = 100%
{W} => {O, Z} 4/8 × 100 = 50% 4/4 × 100 = 100%

You might also like