# Apriori candidate pruning

Dataset of frequent 3-itemsets before running the algorithm:

{1, 2, 3}, {1, 2, 4}, {1, 2, 5}, {1, 2, 6}, {1, 3, 4}, {1, 3, 5},
{1, 3, 6}, {2, 3, 4}, {2, 3, 6}, {2, 3, 5}, {3, 4, 5}, {3, 4,6}, {4, 5, 6}.


Assuming there are only six items in the data set.

What is the list of all candidate 4-itemsets obtained by the candidate generation procedure in Apriori algorithm?

What are all candidate 4-itemsets that survive the candidate pruning step of the Apriori Algorithm?

After using Apriori I get:

$${\{1,2}\}, {\{1,3}\}, {\{1,2,5}\}, {\{2,3,6}\}$$

• The wikipedia article about apriori is poor. I suggest to try the links in that answer to a similar question (first link is broken, but the others are fine). For this question: What are the transactions at the start of the algorithm ? Those are needed in order to get from the frequent 3- to the frequent 4-itensets. As it stands, this question cannot be answered. Nov 22, 2013 at 17:33
• @steffen I made it more clear what the transactions are. Also added a bounty if you are still interested in helping. Thanks. Nov 24, 2013 at 16:19
• If I understand you correctly, then the frequent 3-itemsets do represent these initial transactions => no customer has more than 3 items in one transaction => no frequent 4-itemset does exist. To calculate the frequent 4-itemsets, one needs to know which transactions with at least 4 items do exist. Hence an answer to your question (as it stands) can only contain the candidate itemsets, but cannot perform the pruning. Nov 25, 2013 at 9:46
• The Apriori algorithm is just a faster approach to calculate the frequent x-itemsets bottom up instead of stepping over all transactions for every x. A frequent x-itemset is a set which has appeared a mininum number of times in all transactions, hence to get frequent y-itemsets, one needs transactions with at least y items. Hope this was helpful. Nov 25, 2013 at 9:52
• @steffen thanks. I was able to do it. With the assumption that the pruning is done on support 0 some 4-itemsets sets can be pruned. Nov 25, 2013 at 12:09

$${\{1236}\};{\{1235}\};{\{1234}\};{\{1245}\}$$