ca.pfv.spmf.algorithms.frequentpatterns.lcm
Class AlgoLCM
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.lcm.AlgoLCM
-
public class AlgoLCM extends java.lang.ObjectThis is an implementation of the LCM algorithm for mining frequent closed itemsets from a transaction database. More information on the LCM algorithm can be found in papers by T. Uno, such as:
T. Uno, M. Kiyomi, and H. Arimura. Lcm ver. 2: Efficient mining algorithms for frequent/closed/maximal itemsets. In FIMI, 2004 This implementation of LCM was made by Alan Souza and was modified by Philippe Fournier-Viger to add optimizations and support for LCMFreq/LCMMax (note LCMMax has been temporarily removed in the current version of SPMF).
The implementation is similar to LCM version 2 with some differences. For example, transaction merging is not performed yet and items in transactions are not sorted in descending order of frequency.
-
-
Constructor Summary
Constructors Constructor and Description AlgoLCM()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description booleancontainsByBinarySearch(java.util.List<java.lang.Integer> items, java.lang.Integer item)booleancontainsByBinarySearch(java.util.List<java.lang.Integer> items, java.lang.Integer item, int searchAfterPosition)Check if an item appears in this itemsetjava.util.List<Transaction>intersectTransactions(java.util.List<Transaction> transactionsOfP, java.lang.Integer e)Calculate the transactions of the union of an itemset "P" with an item "e".voidperformFirstOccurenceDelivery(Dataset dataset)Perform the initial occurence delivery with the original dataset containing all itemsvoidprintStats()Print statistics about the latest execution of the algorithm.ItemsetsrunAlgorithm(double minimumSupport, Dataset dataset, java.lang.String outputPath, boolean mineAllFrequentItemsets, boolean mineAllMaximalItemsets)Run the algorithm
-
-
-
Method Detail
-
runAlgorithm
public Itemsets runAlgorithm(double minimumSupport, Dataset dataset, java.lang.String outputPath, boolean mineAllFrequentItemsets, boolean mineAllMaximalItemsets) throws java.io.IOException
Run the algorithm- Parameters:
minimumSupport- the minimum support threshold as percentage value between 0 and 1dataset- the datasetoutputPath- the output file path to save the result or null if to be kept in memorymineAllFrequentItemsets- mine all frequent itemsetsmineAllMaximalItemsets- mine only maximal itemsets- Returns:
- the itemsets or null if the user choose to save to file
- Throws:
java.io.IOException- if exception while reading/writing to file
-
performFirstOccurenceDelivery
public void performFirstOccurenceDelivery(Dataset dataset)
Perform the initial occurence delivery with the original dataset containing all items- Parameters:
dataset-
-
containsByBinarySearch
public boolean containsByBinarySearch(java.util.List<java.lang.Integer> items, java.lang.Integer item, int searchAfterPosition)Check if an item appears in this itemset- Parameters:
item- the item- Returns:
- true if it appears. Otherwise, false.
-
containsByBinarySearch
public boolean containsByBinarySearch(java.util.List<java.lang.Integer> items, java.lang.Integer item)
-
intersectTransactions
public java.util.List<Transaction> intersectTransactions(java.util.List<Transaction> transactionsOfP, java.lang.Integer e)
Calculate the transactions of the union of an itemset "P" with an item "e".- Parameters:
transactionsOfP- the transactions containing Pe- the item "e"- Returns:
- the transactions containing P U "e"
-
printStats
public void printStats()
Print statistics about the latest execution of the algorithm.
-
-
DMelt 3.0 © DataMelt by jWork.ORG