ca.pfv.spmf.algorithms.frequentpatterns.fpgrowth
Class AlgoFPGrowth
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.fpgrowth.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 and Description intrelativeMinsupp
-
Constructor Summary
Constructors Constructor and Description AlgoFPGrowth()Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and 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)Method to run the FPGRowth algorithm.
-
-
-
Method Detail
-
runAlgorithm
public Itemsets runAlgorithm(java.lang.String input, java.lang.String output, double minsupp) throws java.io.FileNotFoundException, java.io.IOException
Method to run the FPGRowth algorithm.- Parameters:
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
-
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.
-
-
DMelt 3.0 © DataMelt by jWork.ORG