ca.pfv.spmf.algorithms.frequentpatterns.apriori
Class AlgoApriori
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.apriori.AlgoApriori
-
public class AlgoApriori extends java.lang.ObjectThis is an optimized implementation of the Apriori algorithm that uses binary search to check if subsets of a candidate are frequent and other optimizations.
The apriori algorithm is described in :
Agrawal R, Srikant R. "Fast Algorithms for Mining Association Rules", VLDB. Sep 12-15 1994, Chile, 487-99,
The Apriori algorithm finds all the frequents itemsets and their support in a transaction database provided by the user.
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.
-
-
Constructor Summary
Constructors Constructor and Description AlgoApriori()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetDatabaseSize()Return the number of transactions in the last database read by the algorithm.voidprintStats()Print statistics about the algorithm execution to System.out.ItemsetsrunAlgorithm(double minsup, java.lang.String input, java.lang.String output)Method to run the algorithm
-
-
-
Method Detail
-
runAlgorithm
public Itemsets runAlgorithm(double minsup, java.lang.String input, java.lang.String output) throws java.io.IOException
Method to run the algorithm- Parameters:
minsup- a minimum support value as a percentageinput- the path of an input fileoutput- the path of an input if the result should be saved to a file. If null, the result will be kept into memory and this method will return the result.- Throws:
java.io.IOException- exception if error while writting or reading the input/output file
-
getDatabaseSize
public int getDatabaseSize()
Return the number of transactions in the last database read by the algorithm.- Returns:
- the number of transactions.
-
printStats
public void printStats()
Print statistics about the algorithm execution to System.out.
-
-
DMelt 3.0 © DataMelt by jWork.ORG