DIC Implementation |
Note: The DIC implementation given here may not produce accurate output for small databases (fewer than 100 transactions). To get accurate output for these databases we need to choose step M > 4.
Download the following files:
hercules[1]% javac -deprecation dic.java
Change config.txt and transa.txt to represent the database and criteria to be tested.
Run the programs:
hercules[2]% java dic
Example
We use the database example from Apriori
Itemset Generation. The minsupp is 40%.
TID | A | B | C | D | E |
T1 | 1 | 1 | 1 | 0 | 0 |
T2 | 1 | 1 | 1 | 1 | 1 |
T3 | 1 | 0 | 1 | 1 | 0 |
T4 | 1 | 0 | 1 | 1 | 1 |
T5 | 1 | 1 | 1 | 1 | 0 |
Transa.txt contains a row for each of the five transactions and
a column for each of the five items.
1 1 1 0 0
1 1 1 1 1 1 0 1 1 0 1 0 1 1 1 1 1 1 1 0 |
Config.txt: Here we use 5 as the size of step M for the DIC algorithm
5
5 40 5 |
Output:
hercules[67]% java apriori
Algorithm apriori starting now..... Press 'C' to change the default configuration and transaction files
Input configuration: 5 items, 5 transactions, minsup = 40% Frequent 1-itemsets:
Execution time is: 0 seconds.
|
We get the same results as we did earlier when we did the Apriori algorithm by hand.