Question: we are given four items namely a b c and...
Question details
We are given four items, namely A, B, C, and D. Their corresponding unit profits are p_{A}, p_{B}, p_{C}, and p_{D}. The following shows five transactions with these items. Each row corresponds to a transaction where a non-negative integer shown in the row corresponds to the total number of occurrences of the correspondence item present in the transaction.
T |
A |
B |
C |
D |
t_{1} |
0 |
0 |
3 |
2 |
t_{2} |
3 |
4 |
0 |
0 |
t_{3} |
0 |
0 |
1 |
3 |
t_{4} |
1 |
0 |
3 |
5 |
t_{5} |
6 |
0 |
0 |
0 |
- The frequency of an itemset in a row is defined to be the minimum of the number of occurrences of all items in the itemset. For example, itemset {C, D} in the first row has frequency equals 2. But, itemset {C, D} in the third row has frequency as 1.
- The frequency of an itemset in the dataset is defined to be the sum of the frequencies of the itemset in all rows in the dataset. For example, itemset {C, D} has frequency 2+0+1+3+0=6.
Let f be a function defined on an itemset s (f will be specified later). One example of this functions is
f (s) = i∈s p_{i}. In this example, if s = {C, D}, then f (s) = p_{C}+ p_{D}.
- The profit of an itemset s in the dataset is defined to be the product of the frequency of this itemset in the dataset and f (s). For example, itemset {C, D} has profit 6 × f ({C, D}).
Answer the following question based on the above problem setting.
Assume f (s) = i∈s p_{i}. Suppose that we know p_{A}= 5, p_{B}= 10, p_{C}= 6, and p_{D}= 4. We want to find all itemsets with profit at least 50. Can the Apriori Algorithm be adapted to find these itemsets? If yes, please write down the pseudo-code and illustrate it with the above example. If no, please explain why. In this case, please also design an algorithm for this problem and write down the pseudo-code.