public class FPGrowth extends java.lang.Object implements java.lang.Iterable<ItemSet>
The basic idea of the FP-growth algorithm can be described as a recursive elimination scheme: in a preprocessing step delete all items from the transactions that are not frequent individually, i.e., do not appear in a user-specified minimum number of transactions. Then select all transactions that contain the least frequent item (least frequent among those that are frequent) and delete this item from them. Recurse to process the obtained reduced (also known as projected) database, remembering that the item sets found in the recursion share the deleted item as a prefix. On return, remove the processed item from the database of all transactions and start over, i.e., process the second frequent item etc. In these processing steps the prefix tree, which is enhanced by links between the branches, is exploited to quickly find the transactions containing a given item and also to remove this item from the transactions after it has been processed.
| Modifier and Type | Method and Description |
|---|---|
static java.util.stream.Stream<ItemSet> |
apply(FPTree tree)
Mines the frequent item sets.
|
java.util.Iterator<ItemSet> |
iterator() |
int |
size()
Returns the number transactions in the database.
|