ca.pfv.spmf.algorithms.frequentpatterns.two_phase
Class ItemsetTP
- java.lang.Object
-
- ca.pfv.spmf.algorithms.frequentpatterns.two_phase.ItemsetTP
-
public class ItemsetTP extends java.lang.ObjectThis class represents an itemset (a set of items) with utility information found by the TWO-PHASE algorithm.- See Also:
AlgoTwoPhase
-
-
Constructor Summary
Constructors Constructor and Description ItemsetTP()Default constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddItem(java.lang.Integer value)Add an item to that itemsetjava.lang.Integerget(int index)Get the item at at a given position in that itemsetintgetAbsoluteSupport()Get the absolute support of that itemsetjava.util.List<java.lang.Integer>getItems()Get items from that itemset.doublegetRelativeSupport(int nbObject)Get the relative support of this itemsetjava.lang.StringgetRelativeSupportAsString(int nbObject)Get the relative support of this itemsetjava.util.Set<java.lang.Integer>getTIDset()Get the set of transactions ids containing this itemsetintgetUtility()Get the utility of this itemset.voidincrementUtility(int increment)Increase the utility of this itemset by a given amount.voidprint()print this itemset to System.out.voidsetTIDset(java.util.Set<java.lang.Integer> listTransactionIds)Set the tidset of this itemset.intsize()Get the number of items in this itemsetjava.lang.StringtoString()Get a string representation of this itemset
-
-
-
Method Detail
-
getRelativeSupport
public double getRelativeSupport(int nbObject)
Get the relative support of this itemset- Parameters:
nbObject- the number of transactions- Returns:
- the support
-
getRelativeSupportAsString
public java.lang.String getRelativeSupportAsString(int nbObject)
Get the relative support of this itemset- Parameters:
nbObject- the number of transactions- Returns:
- the support
-
getAbsoluteSupport
public int getAbsoluteSupport()
Get the absolute support of that itemset- Returns:
- the absolute support (integer)
-
addItem
public void addItem(java.lang.Integer value)
Add an item to that itemset- Parameters:
value- the item to be added
-
getItems
public java.util.List<java.lang.Integer> getItems()
Get items from that itemset.- Returns:
- a list of integers (items).
-
get
public java.lang.Integer get(int index)
Get the item at at a given position in that itemset- Parameters:
index- the position- Returns:
- the item (Integer)
-
print
public void print()
print this itemset to System.out.
-
toString
public java.lang.String toString()
Get a string representation of this itemset- Overrides:
toStringin classjava.lang.Object- Returns:
- a string
-
setTIDset
public void setTIDset(java.util.Set<java.lang.Integer> listTransactionIds)
Set the tidset of this itemset.- Parameters:
listTransactionIds- a set of tids as a Set
-
size
public int size()
Get the number of items in this itemset- Returns:
- the item count (int)
-
getTIDset
public java.util.Set<java.lang.Integer> getTIDset()
Get the set of transactions ids containing this itemset- Returns:
- a tidset as a Set
-
getUtility
public int getUtility()
Get the utility of this itemset.- Returns:
- utility as an int
-
incrementUtility
public void incrementUtility(int increment)
Increase the utility of this itemset by a given amount.- Parameters:
increment- the amount.
-
-
DMelt 3.0 © DataMelt by jWork.ORG