@Test
public void testSpecificCaseFromRetailDataMinSup500() throws IOException {
FPGrowth<String> fp = new FPGrowth<String>();
StringRecordIterator it = new StringRecordIterator(new FileLineIterable(Resources.getResource(
"retail.dat").openStream()), "\\s+");
int pattern_41_36_39 = 0;
while (it.hasNext()) {
Pair<List<String>,Long> next = it.next();
List<String> items = next.getFirst();
if (items.contains("41") && items.contains("36") && items.contains("39")) {
pattern_41_36_39++;
}
}
final Map<Set<String>,Long> results = Maps.newHashMap();
Set<String> returnableFeatures = Sets.newHashSet();
returnableFeatures.add("41");
returnableFeatures.add("36");
returnableFeatures.add("39");
fp.generateTopKFrequentPatterns(
new StringRecordIterator(new FileLineIterable(Resources.getResource("retail.dat").openStream()), "\\s+"),
fp.generateFList(new StringRecordIterator(new FileLineIterable(Resources.getResource("retail.dat")
.openStream()), "\\s+"), 500), 500, 1000, returnableFeatures,
new OutputCollector<String,List<Pair<List<String>,Long>>>() {
@Override
public void collect(String key, List<Pair<List<String>,Long>> value) {