Hi,
I will give you the code to make a loop on all the itemsets and show them.
The idea is to use algo2.getItemsets() to obtain all the maximal itemsets found.
The itemset found are stored in an instance of the class Itemsets that store itemsets by their size. For example, itemsets of level 1 are itemsets containing 1 item. Itemsets of level 2 are itemsets containing 2 items, ....
So to access the itemsets found and print them you can do like that:
Itemsets itemsets = algo2.getItemsets();
for(List<Itemset> level : itemsets.getLevels()) {
for(Itemset itemset : level) {
for(Integer item : itemset.itemset) {
System.out.print(item );
}
System.out.println( " support " + itemset.getAbsoluteSupport());
}
}
Important: Make sure that you add the following import statement on the top of the test file:
import ca.pfv.spmf.patterns.itemset_set_integers_with_tids.*
Best,
Philippe