ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan_with_strings
Class SequentialPattern
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequentialpatterns.BIDE_and_prefixspan_with_strings.SequentialPattern
-
public class SequentialPattern extends java.lang.ObjectThis class represents a sequential pattern found by the PrefixSpan or BIDE algorithm. A sequential pattern is represented by these algorithms as a list of itemsets with an associated hash set indicating the IDS of the sequence containing this sequential pattern.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description Itemsetget(int index)Get an itemset at a given position.intgetAbsoluteSupport()Get the absolute support of this pattern.intgetId()java.util.List<Itemset>getItemsets()Get the itemsets in this sequential patternjava.lang.StringgetIthItem(int i)Get the ith item in this sequential pattern.java.lang.StringgetRelativeSupportFormated(int sequencecount)Get the relative support of this pattern (a percentage)java.util.Set<java.lang.Integer>getSequencesID()java.lang.StringitemsetsToString()Get a string representation of this sequential pattern.voidprint()Print this sequential pattern to System.outvoidsetID(int id2)intsize()Get the number of itemsets in this sequential pattern.java.lang.StringtoString()Get a string representation of this sequential pattern, containing the sequence IDs of sequence containing this pattern.
-
-
-
Method Detail
-
getRelativeSupportFormated
public java.lang.String getRelativeSupportFormated(int sequencecount)
Get the relative support of this pattern (a percentage)- Parameters:
sequencecount- the number of sequences in the original database- Returns:
- the support as a string
-
getAbsoluteSupport
public int getAbsoluteSupport()
Get the absolute support of this pattern.- Returns:
- the support (an integer >= 1)
-
print
public void print()
Print this sequential pattern to System.out
-
toString
public java.lang.String toString()
Get a string representation of this sequential pattern, containing the sequence IDs of sequence containing this pattern.- Overrides:
toStringin classjava.lang.Object
-
itemsetsToString
public java.lang.String itemsetsToString()
Get a string representation of this sequential pattern.
-
getId
public int getId()
-
getItemsets
public java.util.List<Itemset> getItemsets()
Get the itemsets in this sequential pattern- Returns:
- a list of itemsets.
-
get
public Itemset get(int index)
Get an itemset at a given position.- Parameters:
index- the position- Returns:
- the itemset
-
getIthItem
public java.lang.String getIthItem(int i)
Get the ith item in this sequential pattern.- Parameters:
i- the position of the item.- Returns:
- the item or null if the position does not exist.
-
size
public int size()
Get the number of itemsets in this sequential pattern.- Returns:
- the number of itemsets.
-
getSequencesID
public java.util.Set<java.lang.Integer> getSequencesID()
-
setID
public void setID(int id2)
-
-
DMelt 3.0 © DataMelt by jWork.ORG