ca.pfv.spmf.algorithms.frequentpatterns.two_phase
Class ItemsetsTP
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.two_phase.ItemsetsTP
-
public class ItemsetsTP extends java.lang.ObjectThis class represents a set of high utility itemsets found by the Two-Phase algorithm. They are ordered by size. For example, "level 1" means the itemsets of size 1 (containing 1 item).- See Also:
ItemsetTP,AlgoTwoPhase
-
-
Constructor Summary
Constructors Constructor and Description ItemsetsTP(java.lang.String name)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddItemset(ItemsetTP itemset, int k)Add an itemset to these itemsets.voiddecreaseCount()Decrease the total number of itemsets by 1.intgetItemsetsCount()Get the total number of itemsets.java.util.List<java.util.List<ItemsetTP>>getLevels()Get the itemsets stored in this structure as a List of List where position i contains the list of itemsets of size i.voidprintItemsets(int transactionCount)Print all itemsets to System.outvoidsaveResultsToFile(java.lang.String output, int transactionCount)Save the itemsets to the file
-
-
-
Constructor Detail
-
ItemsetsTP
public ItemsetsTP(java.lang.String name)
Constructor.- Parameters:
name- a name to give to these itemsets
-
-
Method Detail
-
printItemsets
public void printItemsets(int transactionCount)
Print all itemsets to System.out- Parameters:
transactionCount- the number of transaction in the database
-
saveResultsToFile
public void saveResultsToFile(java.lang.String output, int transactionCount) throws java.io.IOExceptionSave the itemsets to the file- Parameters:
output- the output file pathtransactionCount- the number of transactions in the database- Throws:
java.io.IOException- exception if error while writing the file
-
addItemset
public void addItemset(ItemsetTP itemset, int k)
Add an itemset to these itemsets.- Parameters:
itemset- the itemset to be addedk- the size of the itemset
-
getLevels
public java.util.List<java.util.List<ItemsetTP>> getLevels()
Get the itemsets stored in this structure as a List of List where position i contains the list of itemsets of size i.- Returns:
- the itemsets.
-
getItemsetsCount
public int getItemsetsCount()
Get the total number of itemsets.- Returns:
- the itemset count.
-
decreaseCount
public void decreaseCount()
Decrease the total number of itemsets by 1.
-
-
DMelt 3.0 © DataMelt by jWork.ORG