Class AlgoFPGrowth
- java.lang.Object
-
- org.processmining.logfiltering.algorithms.SPMF.PatternMining.AlgoFPGrowth
-
public class AlgoFPGrowth extends java.lang.ObjectThis is an implementation of the FPGROWTH algorithm (Han et al., 2004). FPGrowth is described here:
Han, J., Pei, J., & Yin, Y. (2000, May). Mining frequent patterns without candidate generation. In ACM SIGMOD Record (Vol. 29, No. 2, pp. 1-12). ACM
This is an optimized version that saves the result to a file or keep it into memory if no output path is provided by the user to the runAlgorithm method().
-
-
Field Summary
Fields Modifier and Type Field Description intminSupportRelativeprotected Itemsetspatterns
-
Constructor Summary
Constructors Constructor Description AlgoFPGrowth(int oddDistance)AlgoFPGrowth(int i, int minSupport)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intgetDatabaseSize()Get the number of transactions in the last transaction database read.voidprintStats()Print statistics about the algorithm execution to System.out.ItemsetsrunAlgorithm(java.lang.String input, java.lang.String output, double minsupp)ItemsetsrunAlgorithm(FPTree tree, int logSize, java.util.HashMap<java.lang.Integer,java.lang.Integer> mapSupport, java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> mapTraceList, java.util.List<java.lang.Integer> mapTraces)Method to run the FPGRowth algorithm.voidsetMaximumPatternLength(int length)Set the maximum pattern length
-
-
-
Field Detail
-
minSupportRelative
public int minSupportRelative
-
patterns
protected Itemsets patterns
-
-
Method Detail
-
runAlgorithm
public Itemsets runAlgorithm(FPTree tree, int logSize, java.util.HashMap<java.lang.Integer,java.lang.Integer> mapSupport, java.util.HashMap<java.lang.Integer,java.util.List<java.lang.Integer>> mapTraceList, java.util.List<java.lang.Integer> mapTraces) throws java.io.FileNotFoundException, java.io.IOException
Method to run the FPGRowth algorithm.- Parameters:
mapTraceList-mapTraces-input- the path to an input file containing a transaction database.output- the output file path for saving the result (if null, the result will be returned by the method instead of being saved).minsupp- the minimum support threshold.- Returns:
- the result if no output file path is provided.
- Throws:
java.io.IOException- exception if error reading or writing filesjava.io.FileNotFoundException
-
runAlgorithm
public Itemsets runAlgorithm(java.lang.String input, java.lang.String output, double minsupp) throws java.io.FileNotFoundException, java.io.IOException
- Throws:
java.io.FileNotFoundExceptionjava.io.IOException
-
printStats
public void printStats()
Print statistics about the algorithm execution to System.out.
-
getDatabaseSize
public int getDatabaseSize()
Get the number of transactions in the last transaction database read.- Returns:
- the number of transactions.
-
setMaximumPatternLength
public void setMaximumPatternLength(int length)
Set the maximum pattern length- Parameters:
length- the maximum length
-
-