ca.pfv.spmf.algorithms.frequentpatterns.aprioriTID
Class AlgoAprioriTID
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.aprioriTID.AlgoAprioriTID
-
public class AlgoAprioriTID extends java.lang.ObjectThis is an implementation of the AprioriTID algorithm.
The AprioriTID algorithm finds all the frequents itemsets and their support in a binary context.
AprioriTID can be faster than Apriori and produce the same result.
AprioriTID was originally proposed in :
Agrawal R, Srikant R. "Fast Algorithms for Mining Association Rules", VLDB. Sep 12-15 1994, Chile, 487-99,
This implementation can save the result to a file or keep it into memory if no output path is provided to the runAlgorithm() method.
-
-
Constructor Summary
Constructors Constructor and Description AlgoAprioriTID()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description intgetDatabaseSize()Get the number of transactions in the last database read.voidprintStats()Print statistics about the algorithm execution to System.out.ItemsetsrunAlgorithm(java.lang.String input, java.lang.String output, double minsup)This method run the algorithm.ItemsetsrunAlgorithm(TransactionDatabase database, double minsup)This method run the algorithm on a transaction database already in memory.voidsetEmptySetIsRequired(boolean emptySetIsRequired)Method to indicate if the empty set should be included in results or not.voidsetMaxItemsetSize(int maxItemsetSize)Set the maximum itemset size of itemsets to be found
-
-
-
Method Detail
-
runAlgorithm
public Itemsets runAlgorithm(TransactionDatabase database, double minsup) throws java.lang.NumberFormatException, java.io.IOException
This method run the algorithm on a transaction database already in memory.- Parameters:
database- the transaction databaseminsup- the minimum support threshold as a percentage (double)- Returns:
- the method returns frequent itemsets
- Throws:
java.io.IOException- exception if error reading/writing the filejava.lang.NumberFormatException
-
runAlgorithm
public Itemsets runAlgorithm(java.lang.String input, java.lang.String output, double minsup) throws java.lang.NumberFormatException, java.io.IOException
This method run the algorithm.- Parameters:
input- the file path of an input file. if null, the result is returned by the method.output- the output file pathminsup- the minimum support threshold as a percentage (double)- Returns:
- if no output file path is provided, the method return frequent itemsets, otherwise null
- Throws:
java.io.IOException- exception if error reading/writing the filejava.lang.NumberFormatException
-
setMaxItemsetSize
public void setMaxItemsetSize(int maxItemsetSize)
Set the maximum itemset size of itemsets to be found- Parameters:
maxItemsetSize- maximum itemset size.
-
setEmptySetIsRequired
public void setEmptySetIsRequired(boolean emptySetIsRequired)
Method to indicate if the empty set should be included in results or not.- Parameters:
emptySetIsRequired- if true the empty set will be included.
-
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 database read.- Returns:
- number of transactions.
-
-
DMelt 3.0 © DataMelt by jWork.ORG