Apriori
Apriori copied to clipboard
no pruning in Apriori function
This is what we should implement in code with pruning.
- Let k=1
- Generate frequent itemsets of length k
- Repeat until no new frequent itemsets are identified
- Generate length (k+1) candidate itemsets from length k frequent itemsets
- Prune candidate itemsets containing subsets of length k+1 that are infrequent
- Count the support of each candidate by scanning the DB
- Eliminate candidates that are infrequent, leaving only those that are frequent
Hi @zoeleesss , I have written one that included the pruning step that you expected. It's also a Python implementation of Apriori algorithm. Feel free to check it out! https://github.com/chonyy/apriori_python