Class Sequence
- java.lang.Object
-
- org.processmining.logfiltering.algorithms.SPMF.RuleGrowth.Sequence
-
public class Sequence extends java.lang.ObjectImplementation of a sequence as a list of itemsets, where an itemset is a list of integers.- Author:
- Philipe-Fournier-Viger
- See Also:
SequenceDatabase
-
-
Constructor Summary
Constructors Constructor Description Sequence(int id)Constructor
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddItemset(java.util.List<java.lang.Integer> itemset)Add an itemset to this sequence.java.util.List<java.lang.Integer>cloneItemsetMinusItems(double relativeMinsup, java.util.List<java.lang.Integer> itemset, java.util.Map<java.lang.Integer,java.util.Set<Sequence>> mapSequenceID)Make a copy of an itemset while removing some items that are infrequent with respect to a threshold minsup.java.util.List<java.lang.Integer>cloneItemsetMinusItems(java.util.List<java.lang.Integer> itemset, java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> mapSequenceID, double minSupportAbsolute)Make a copy of an itemset while removing some items that are infrequent with respect to a threshold minsup.SequencecloneSequenceMinusItems(double relativeMinSup, java.util.Map<java.lang.Integer,java.util.Set<Sequence>> mapSequenceID)Make a copy of this sequence while removing some items that are infrequent with respect to a threshold minsup.SequencecloneSequenceMinusItems(java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> mapSequenceID, double relativeMinSup)Make a copy of this sequence while removing some items that are infrequent with respect to a threshold minsup.java.util.List<java.lang.Integer>get(int index)Get the itemset at a given position in this sequence.intgetId()Get the sequence ID of this sequence.java.util.List<java.util.List<java.lang.Integer>>getItemsets()Get the list of itemsets in this sequence.voidprint()Print this sequence to System.out.intsize()Get the size of this sequence (number of itemsets).java.lang.StringtoString()Return a string representation of this sequence.
-
-
-
Method Detail
-
addItemset
public void addItemset(java.util.List<java.lang.Integer> itemset)
Add an itemset to this sequence.- Parameters:
itemset- An itemset (list of integers)
-
print
public void print()
Print this sequence to System.out.
-
toString
public java.lang.String toString()
Return a string representation of this sequence.- Overrides:
toStringin classjava.lang.Object
-
getId
public int getId()
Get the sequence ID of this sequence.
-
getItemsets
public java.util.List<java.util.List<java.lang.Integer>> getItemsets()
Get the list of itemsets in this sequence.- Returns:
- the list of itemsets.
-
get
public java.util.List<java.lang.Integer> get(int index)
Get the itemset at a given position in this sequence.- Parameters:
index- the position- Returns:
- the itemset as a list of integers.
-
size
public int size()
Get the size of this sequence (number of itemsets).- Returns:
- the size (an integer).
-
cloneSequenceMinusItems
public Sequence cloneSequenceMinusItems(java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> mapSequenceID, double relativeMinSup)
Make a copy of this sequence while removing some items that are infrequent with respect to a threshold minsup.- Parameters:
mapSequenceID- a map with key = item value = a set of sequence ids containing this itemrelativeMinSup- the minimum support threshold chosen by the user.- Returns:
- a copy of this sequence except that item(s) with a support lower than minsup have been excluded.
-
cloneSequenceMinusItems
public Sequence cloneSequenceMinusItems(double relativeMinSup, java.util.Map<java.lang.Integer,java.util.Set<Sequence>> mapSequenceID)
Make a copy of this sequence while removing some items that are infrequent with respect to a threshold minsup.- Parameters:
mapSequenceID- a map with key = item value = a set of sequence containing this itemrelativeMinSup- the minimum support threshold chosen by the user.- Returns:
- a copy of this sequence except that item(s) with a support lower than minsup have been excluded.
-
cloneItemsetMinusItems
public java.util.List<java.lang.Integer> cloneItemsetMinusItems(double relativeMinsup, java.util.List<java.lang.Integer> itemset, java.util.Map<java.lang.Integer,java.util.Set<Sequence>> mapSequenceID)Make a copy of an itemset while removing some items that are infrequent with respect to a threshold minsup.- Parameters:
mapSequenceID- a map with key = item value = a set of sequence containing this itemrelativeMinsup- the minimum support threshold chosen by the user.itemset- the itemset- Returns:
- a copy of this itemset except that item(s) with a support lower than minsup have been excluded.
-
cloneItemsetMinusItems
public java.util.List<java.lang.Integer> cloneItemsetMinusItems(java.util.List<java.lang.Integer> itemset, java.util.Map<java.lang.Integer,java.util.Set<java.lang.Integer>> mapSequenceID, double minSupportAbsolute)Make a copy of an itemset while removing some items that are infrequent with respect to a threshold minsup.- Parameters:
mapSequenceID- a map with key = item value = a set of sequence ids containing this itemminSupportAbsolute- the minimum support threshold chosen by the user.itemset- the itemset- Returns:
- a copy of this itemset except that item(s) with a support lower than minsup have been excluded.
-
-