Package elki.itemsetmining
Class FPGrowth.FPTree
- java.lang.Object
-
- elki.itemsetmining.FPGrowth.FPNode
-
- elki.itemsetmining.FPGrowth.FPTree
-
- Enclosing class:
- FPGrowth
public static class FPGrowth.FPTree extends FPGrowth.FPNode
FP-Tree data structure- Author:
- Erich Schubert
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description (package private) static interface
FPGrowth.FPTree.Collector
Interface for collecting frequent itemsets found.-
Nested classes/interfaces inherited from class elki.itemsetmining.FPGrowth.FPNode
FPGrowth.FPNode.Translator
-
-
Field Summary
Fields Modifier and Type Field Description (package private) FPGrowth.FPNode[]
header
Header table(package private) int
nodes
Number of nodes in the tree (statistics only).-
Fields inherited from class elki.itemsetmining.FPGrowth.FPNode
children, count, EMPTY_CHILDREN, INITIAL_SIZE, key, numchildren, parent, sibling
-
-
Constructor Summary
Constructors Constructor Description FPTree(int items)
Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description void
extract(int minsupp, int minlength, int maxlength, boolean destruct, FPGrowth.FPTree.Collector col)
Extract itemsets ending in the given item.private void
extract(int minsupp, int minlength, int maxlength, int item, int[] postfix, int plen, int[] buf2, int[] buf3, boolean destruct, FPGrowth.FPTree.Collector col)
Extract itemsets ending in the given item.private void
extractLinear(int supp, int minlength, int maxlength, int item, int[] postfix, int plen, int[] buf2, FPGrowth.FPTree.Collector col)
Extract itemsets from a linear tree.void
insert(int[] buf, int i, int l, int weight)
Insert an itemset into the tree.void
logStatistics()
Output some statistics to logging.FPGrowth.FPNode
newNode(FPGrowth.FPNode parent, int label)
Create a new node of the FP-tree, linking it into the header table.-
Methods inherited from class elki.itemsetmining.FPGrowth.FPNode
appendTo, insert, reduceMemory
-
-
-
-
Field Detail
-
header
FPGrowth.FPNode[] header
Header table
-
nodes
int nodes
Number of nodes in the tree (statistics only).
-
-
Method Detail
-
insert
public void insert(int[] buf, int i, int l, int weight)
Insert an itemset into the tree.- Parameters:
buf
- Bufferi
- Start position in bufferl
- End position in bufferweight
- Weight
-
newNode
public FPGrowth.FPNode newNode(FPGrowth.FPNode parent, int label)
Create a new node of the FP-tree, linking it into the header table.- Parameters:
parent
- Parent nodelabel
- Node label- Returns:
- New node
-
extract
public void extract(int minsupp, int minlength, int maxlength, boolean destruct, FPGrowth.FPTree.Collector col)
Extract itemsets ending in the given item.- Parameters:
minsupp
- Minimum supportminlength
- Minimum lengthmaxlength
- Maximum lengthdestruct
- Remove nodescol
- Itemset collector
-
extract
private void extract(int minsupp, int minlength, int maxlength, int item, int[] postfix, int plen, int[] buf2, int[] buf3, boolean destruct, FPGrowth.FPTree.Collector col)
Extract itemsets ending in the given item.- Parameters:
minsupp
- Minimum supportminlength
- Minimum lengthmaxlength
- Maximum lengthitem
- Current itempostfix
- Items to appendplen
- Postfix lengthbuf2
- Scratch bufferbuf3
- Scratch bufferdestruct
- Remove nodescol
- Itemset collector
-
extractLinear
private void extractLinear(int supp, int minlength, int maxlength, int item, int[] postfix, int plen, int[] buf2, FPGrowth.FPTree.Collector col)
Extract itemsets from a linear tree.- Parameters:
supp
- Current supportminlength
- Minimum lengthmaxlength
- Maximum lengthitem
- Current itempostfix
- Postfix for extracted itemsetsplen
- Postfix lengthbuf2
- Scratch buffercol
- Output collector
-
logStatistics
public void logStatistics()
Output some statistics to logging.
-
-