FPGrowth { protected FPTree constructTree(List<Set<Integer>> transactions, int supportCount) { FPTree fp = new FPTree(); fp.insertFrequentItems(transactions, supportCount); fp.insertTransactions(transactions); return fp; }  List<ItemsetWithCount> getItemsetsWithSupportRatio(List<Set<Integer>> transactions,
                                                              Double supportRatio); List<ItemsetWithCount> getItemsetsWithSupportRatio(List<Set<Integer>> transactions,
                                                              Map<Integer, Double> initialCounts,
                                                              Double supportRatio); List<ItemsetWithCount> getItemsetsWithSupportCount(List<Set<Integer>> transactions,
                                                              Double supportCount); List<ItemsetWithCount> getItemsetsWithSupportCount(List<Set<Integer>> transactions,
                                                              Map<Integer, Double> initialCounts,
                                                              Double supportCount); List<ItemsetWithCount> getItemsetsWithSupportCount(List<Set<Integer>> transactions,
                                                              Map<Integer, Double> initialCounts,
                                                              Double supportCount,
                                                              boolean printTreeDebug); List<ItemsetWithCount> getCounts(
            List<Set<Integer>> transactions,
            Map<Integer, Double> initialCounts,
            Set<Integer> targetItems,
            List<ItemsetWithCount> toCount);  }
@Test public void testGetSupport() { List<Set<Integer>> txns = new ArrayList<>(); txns.add(intIfy("a, c, d")); txns.add(intIfy("a, c, d, e")); txns.add(intIfy("c")); txns.add(intIfy("a")); txns.add(intIfy("a")); txns.add(intIfy("a")); txns.add(intIfy("a")); txns.add(intIfy("a")); txns.add(intIfy("b")); txns.add(intIfy("b")); txns.add(intIfy("b")); txns.add(intIfy("a, b, d")); txns.add(intIfy("a, b, e, c")); FPGrowth.FPTree fpt = new FPGrowth().constructTree(txns, 0); assertEquals(2, fpt.getSupport(intIfy("a, b"))); assertEquals(0, fpt.getSupport(intIfy("a, b, c, d"))); }