ca.pfv.spmf.algorithms.frequentpatterns.apriori_HT
Class AlgoAprioriHT
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.apriori_HT.AlgoAprioriHT
-
public class AlgoAprioriHT extends java.lang.ObjectThis is an implementation of the Apriori algorithm that use an Hash-tree to store candidates, to calculate their support and to generate candidates efficiently. The other version (AlgoApriori) do not use a hash tree.
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.
Note that the performance of the Hash-Tree version of Apriori depends on the BRANCH COUNT value in the class ItemsetHashTree. In my test, I have used a value of 30 because it seems to provide the best results. But other values could also be used (see Agrawal & Srikant for details). To change the branch_count variable, see the ItemsetHashTree class (default is 30).- See Also:
Itemset,AbstractOrderedItemsetsAdapter,ItemsetHashTree
-
-
Constructor Summary
Constructors Constructor and Description AlgoAprioriHT()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidprintStats()Method to print statistics about the execution of the algorithm.voidrunAlgorithm(double minsup, java.lang.String input, java.lang.String output, int hash_tree_branch_count)Run the Apriori-HT algorithm
-
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm(double minsup, java.lang.String input, java.lang.String output, int hash_tree_branch_count) throws java.io.IOExceptionRun the Apriori-HT algorithm- Parameters:
minsup- the minimum support thresholdinput- path to the input fileoutput- path to save the result to an output filehash_tree_branch_count- the number of child nodes for each node in the hash tree- Throws:
java.io.IOException- if an error while reading/writing files
-
printStats
public void printStats()
Method to print statistics about the execution of the algorithm.
-
-
DMelt 3.0 © DataMelt by jWork.ORG