ca.pfv.spmf.algorithms.frequentpatterns.apriori_inverse
Class AlgoAprioriInverse
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.apriori_inverse.AlgoAprioriInverse
-
public class AlgoAprioriInverse extends java.lang.ObjectThis is an implementation of the AprioriInverse algorithm as described by :
Yun Sing Koh, Nathan Rountree: Finding Sporadic Rules Using Apriori-Inverse. PAKDD 2005: 97-106
and the original Apriori article:
Agrawal R, Srikant R. "Fast Algorithms for Mining Association Rules", VLDB. Sep 12-15 1994, Chile, 487-99,
The AprioriInverse algorithm finds all perfectly rare itemsets. A perfectly rare itemset is an itemset such that all its subsets are rare. It is very similar to the original Apriori algorithm. The main difference is that it uses a threshold "maxsup" and that frequent items of size 1 need to have a support not higher than maxsup.
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 AlgoAprioriInverse()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, double maxsup, java.lang.String input, java.lang.String output)Method to run the algorithm
-
-
-
Method Detail
-
runAlgorithm
public Itemsets runAlgorithm(double minsup, double maxsup, 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 percentagemaxsup- a maximum 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 writing 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