- Introduced by
- Jiawei Han, Jian Pei & Yiwen Yin
- Year
- 2000
- Type
- Frequent-itemset mining algorithm
- Family
- Pattern mining
What does it do?
FP-Growth, introduced by Jiawei Han, Jian Pei, and Yiwen Yin in 2000, mines frequent itemsets from transaction data without generating candidate sets.
The 2000 abstract identifies the Apriori-like candidate generate-and-test approach as costly, especially when there are many or long frequent patterns. FP-Growth instead compresses the database into a frequent-pattern tree (FP-tree) in two scans and grows the frequent patterns recursively from that structure.
The intuition behind the method
Apriori finds frequent itemsets by generating candidate combinations and testing each against the database, a process that becomes expensive when patterns are numerous or long. FP-Growth stores the transactions in a prefix tree in which shared leading items occupy a single path, so overlapping transactions are compressed together. Frequent patterns are then read from the tree: for each item, its prefix paths form a smaller conditional tree that is mined recursively, so no candidates are generated.
History
Han, Pei, and Yin introduced FP-Growth in 2000 in ACM SIGMOD Record, presenting it as an alternative to the Apriori-like candidate generate-and-test approach. An extended treatment appeared as a journal article in Data Mining and Knowledge Discovery, cited as the second reference on this page. FP-Growth is usually discussed alongside Apriori, which is candidate-based, and ECLAT, which uses a vertical data format.
When to use it
Choose FP-Growth to mine frequent itemsets from transactional data, such as market baskets or web clickstreams, when many or long frequent patterns make candidate generation in Apriori-like methods costly, as the original abstract reports. It needs only two database scans to build its structure. Do not choose it when the FP-tree cannot fit in memory, which can happen with very large or highly sparse data, where few transactions share prefixes and the tree compresses poorly. FP-Growth returns frequent itemsets only; if the goal is association rules, a separate rule-generation step is still needed. ECLAT, which works with vertical transaction-ID lists, is a common alternative.
Limitations and considerations
- The FP-tree must fit in memory, which may not hold for very large datasets.
- Compression depends on shared prefixes, so the tree is less compact on sparse data and the advantage over candidate-based methods shrinks.
- Recursive construction of conditional FP-trees is more complex to implement than level-wise candidate counting.
- Results depend on the minimum support threshold: a low threshold produces many itemsets, and a high one omits less frequent patterns.
Source conditions do not replace independent scientific review or validation by an analysis engine.
Strengths
- Avoids candidate generation, the step the original abstract identifies as costly in Apriori-like methods.
- Builds its structure with two database scans, rather than one pass per itemset length as level-wise methods do.
- The FP-tree stores shared prefixes once, which reduces memory and repeated counting wherever transactions overlap in their frequent items.
- Mines long frequent patterns directly from conditional trees, without enumerating every candidate of each length.
Applications
- Market-basket analysis in retail.
- Web-usage and clickstream pattern mining.
- Recommendation based on frequently co-occurring items.
- Frequent-itemset mining on workloads with prolific or long frequent patterns, where candidate generation is the bottleneck.
How it works
How it works
A first database scan counts the support of each item, that is, the number of transactions that contain it, and discards items whose support falls below the minimum support threshold (minsup). minsup may be given either as an absolute transaction count or as a fraction of all transactions; the two express the same threshold once scaled by the number of transactions. The surviving frequent items are sorted by descending frequency, so that transactions share tree prefixes and the FP-tree stays compact.
Formula
\text{scan DB: keep items with support} \ge \text{minsup, sort by frequency}A second scan inserts each transaction, restricted to its frequent items in the sorted order, into the FP-tree. Counts are incremented along shared prefix paths, and new branches are added where no prefix matches. A header table links all occurrences of each item.
Formula
\text{second scan: insert each transaction's frequent items into the FP-tree}For each frequent item, processed from the least frequent upward, the algorithm gathers its conditional pattern base: the prefix paths in the tree that lead to that item, each weighted by its count. This records the context in which the item appears.
Formula
\text{for each item: collect its conditional pattern base (prefix paths)}A smaller conditional FP-tree is built from each conditional pattern base and mined recursively, extending the item's suffix to form longer frequent itemsets. Recursion ends at single-path trees, whose itemset combinations are enumerated directly, so all frequent itemsets are obtained without candidate generation.
Formula
\text{build conditional FP-trees recursively to grow frequent patterns}Common pitfalls
- Setting minimum support too low, which produces a very large number of frequent itemsets.
- Assuming it always outperforms Apriori; on small or sparse data the gain can be modest.
- Treating frequent itemsets as rules. Confidence and lift must be computed in a separate step.
- Overlooking memory limits, since the FP-tree may not fit in RAM for large or sparse inputs.
Frequently asked questions
How is FP-Growth faster than Apriori?
Apriori generates candidate itemsets and tests them against the database, scanning it repeatedly. FP-Growth avoids candidate generation: it compresses the transactions into an FP-tree in two scans and mines frequent patterns recursively from that tree. The original abstract identifies candidate generation as costly, especially when there are prolific and/or long frequent patterns. The size of the speed-up depends on the data and the threshold, and should be checked on the user's own data.
What is the FP-tree?
It is a compressed prefix tree built from the frequent items of the database. Transactions that share leading items share a path, node counts record support, and a header table links each item's occurrences. The structure keeps the frequent content of the data in compact form, so patterns can be read from it without rescanning the full database.
How does FP-Growth relate to ECLAT and association rules?
FP-Growth, ECLAT, and Apriori all find frequent itemsets. FP-Growth uses a tree, while ECLAT uses vertical tidset intersection. Finding frequent itemsets is only the first stage; association rules, scored by confidence or lift, are generated from those itemsets in a separate step.
Related methods
Sources
Han, J., Pei, J., & Yin, Y. (2000). Mining frequent patterns without candidate generation. ACM SIGMOD Record, 29(2), 1–12.
Open DOI referenceHan, J., Pei, J., Yin, Y., & Mao, R. (2004). Mining frequent patterns without candidate generation: a frequent-pattern tree approach. Data Mining and Knowledge Discovery, 8(1), 53–87.
Open DOI reference