Implementing Apriori Algorithm in c++/java/python
Budget: $2 – $8 USD
Part 1:
create 30 items usually seen in amazon, k-mart, or any other supermarkets (e.g. diapers, clothes, etc.). (1) create a database of 20 transactions each containing some of these items. the information can be stored in a file, or a dbms (e.g. oracle). (2) repeat (1) by creating 4 additional, different databases each containing 20 transactions. using apriori, generate and print out all the association rules and the input transactions for each of the 5 transaction databases you created (support and confidence should be user-determined parameter values, so the output should show different support and confidence values).
Part 2:
Implement the brute force method and compare the brute force method
with the Apriori algorithm on each of the 5 transaction databases you
created. Present computation (CPU or clock) time to demonstrate that
the Apriori algorithm is faster than the brute force method on each of the
5 transaction databases. The brute force method and Apriori algorithm
should output the same association rules on each database.
The brute force method for finding frequent itemsets works as follows.
Enumerate and generate all possible 1-itemsets and 2-itemsets. There are
30 items, so there are 435 possible 2-itemsets totally. Check to see
whether each possible 1-itemset/2-itemset is frequent. Then enumerate
and generate all possible 3-itemsets. There are 4060 possible 3-itemsets
totally. Check to see whether each possible 3-itemset is frequent. Keep
on doing so until you see none of the possible
k-itemsets is frequent for
some
k, at which point the brute force method terminates without
generating (k+1)-itemsets.
create 30 items usually seen in amazon, k-mart, or any other supermarkets (e.g. diapers, clothes, etc.). (1) create a database of 20 transactions each containing some of these items. the information can be stored in a file, or a dbms (e.g. oracle). (2) repeat (1) by creating 4 additional, different databases each containing 20 transactions. using apriori, generate and print out all the association rules and the input transactions for each of the 5 transaction databases you created (support and confidence should be user-determined parameter values, so the output should show different support and confidence values).
Part 2:
Implement the brute force method and compare the brute force method
with the Apriori algorithm on each of the 5 transaction databases you
created. Present computation (CPU or clock) time to demonstrate that
the Apriori algorithm is faster than the brute force method on each of the
5 transaction databases. The brute force method and Apriori algorithm
should output the same association rules on each database.
The brute force method for finding frequent itemsets works as follows.
Enumerate and generate all possible 1-itemsets and 2-itemsets. There are
30 items, so there are 435 possible 2-itemsets totally. Check to see
whether each possible 1-itemset/2-itemset is frequent. Then enumerate
and generate all possible 3-itemsets. There are 4060 possible 3-itemsets
totally. Check to see whether each possible 3-itemset is frequent. Keep
on doing so until you see none of the possible
k-itemsets is frequent for
some
k, at which point the brute force method terminates without
generating (k+1)-itemsets.
Related categories:
C Programming
Business, Accounting, Human Resources & Legal
Python
C++ Programming
Hadoop