public class FPTree
extends java.lang.Object
Modifier and Type | Method and Description |
---|---|
int |
minSupport()
Returns the required minimum support of item sets in terms
of frequency.
|
static FPTree |
of(double minSupport,
int[][] itemsets)
One-step construction of FP-tree if the database is available in main memory.
|
static FPTree |
of(double minSupport,
java.util.function.Supplier<java.util.stream.Stream<int[]>> supplier)
One-step construction of FP-tree if the database is available as stream.
|
static FPTree |
of(int minSupport,
int[][] itemsets)
One-step construction of FP-tree if the database is available in main memory.
|
static FPTree |
of(int minSupport,
java.util.function.Supplier<java.util.stream.Stream<int[]>> supplier)
One-step construction of FP-tree if the database is available as stream.
|
int |
size()
Returns the number transactions in the database.
|
public static FPTree of(int minSupport, java.util.function.Supplier<java.util.stream.Stream<int[]>> supplier)
minSupport
- the required minimum support of item sets in terms
of frequency.supplier
- a supplier provides an itemset stream. For example, a code block to
open a file and parse lines into a stream of itemsets.
This function will be called twice.public static FPTree of(double minSupport, java.util.function.Supplier<java.util.stream.Stream<int[]>> supplier)
minSupport
- the required minimum support of item sets in terms
of percentage.supplier
- a supplier provides an itemset stream. For example, a code block to
open a file and parse lines into a stream of itemsets.
This function will be called twice.public static FPTree of(int minSupport, int[][] itemsets)
itemsets
- the item set database. Each row is a item set, which
may have different length. The item identifiers have to be in [0, n),
where n is the number of items. Item set should NOT contain duplicated
items. Note that it is reordered after the call.minSupport
- the required minimum support of item sets in terms
of frequency.public static FPTree of(double minSupport, int[][] itemsets)
itemsets
- the item set database. Each row is a item set, which
may have different length. The item identifiers have to be in [0, n),
where n is the number of items. Item set should NOT contain duplicated
items. Note that it is reordered after the call.minSupport
- the required minimum support of item sets in terms
of percentage.public int size()
public int minSupport()