Finding frequent itemsets with Apriori Algorithm?
Finding frequent itemsets with Apriori Algorithm? I am trying to code the apriori algorithm in Java but am facing a problem regarding frequent itemsets. My mininum support is 1% -> each of the itemsets must be in one or more transactions. In order to understand the algorithm, ive started with cardinality 1. Now the more transactions I compute the less correct my implementation gets though it works with less than 4 transactions. private static void checkForFrequentItemSet() { ArrayList<String> transactions = collectTransactions(); ArrayList<String> items = createItemList(); // First Iteration actually, C1 int k = 1; // while(!items.isEmpty()) // { items = generateCandidates(items, k); System.out.println("There are exactly " + items.size() + " frequent itemsets containing " + k + " item(s):"); System.out.println(items);// Remember this is c1 at first iteration k++; ArrayList<String> finalItems = ne...