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}\}$$

  • $\begingroup$ 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. $\endgroup$
    – steffen
    Nov 22, 2013 at 17:33
  • $\begingroup$ @steffen I made it more clear what the transactions are. Also added a bounty if you are still interested in helping. Thanks. $\endgroup$
    – CharlieK
    Nov 24, 2013 at 16:19
  • $\begingroup$ 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. $\endgroup$
    – steffen
    Nov 25, 2013 at 9:46
  • $\begingroup$ 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. $\endgroup$
    – steffen
    Nov 25, 2013 at 9:52
  • $\begingroup$ @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. $\endgroup$
    – CharlieK
    Nov 25, 2013 at 12:09

1 Answer 1


I actually learned a lot about Apriori from steffen when he answered on my post. The answer is this:



Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.