ca.pfv.spmf.input.sequence_database_list_strings
Class Sequence
- java.lang.Object
-
- ca.pfv.spmf.input.sequence_database_list_strings.Sequence
-
public class Sequence extends java.lang.ObjectImplementation of a sequence as a list of itemsets, where an itemset is a list of strings.- See Also:
SequenceDatabase
-
-
Constructor Summary
Constructors Constructor and Description Sequence(int id)Constructor of a sequence
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidaddItemset(java.util.List<java.lang.String> itemset)Add an itemset to this sequence.java.util.List<java.lang.String>cloneItemsetMinusItems(java.util.List<java.lang.String> itemset, java.util.Map<java.lang.String,java.util.Set<java.lang.Integer>> mapSequenceID, double relativeMinsup)Make a copy of an itemset while removing some items that are infrequent with respect to a threshold minsup.SequencecloneSequenceMinusItems(java.util.Map<java.lang.String,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.String>get(int index)Get the itemset at a given position in this sequenceintgetId()Get the sequence ID of this sequence.java.util.List<java.util.List<java.lang.String>>getItemsets()Get the list of itemsets in this sequencevoidprint()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.
-
-
-
Constructor Detail
-
Sequence
public Sequence(int id)
Constructor of a sequence- Parameters:
id- a sequence id that should be unique.
-
-
Method Detail
-
addItemset
public void addItemset(java.util.List<java.lang.String> itemset)
Add an itemset to this sequence.- Parameters:
itemset- An itemset (list of strings).
-
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.String>> getItemsets()
Get the list of itemsets in this sequence- Returns:
- A list of itemsets.
-
get
public java.util.List<java.lang.String> get(int index)
Get the itemset at a given position in this sequence- Parameters:
index- the position- Returns:
- the itemset as a list of strings.
-
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.String,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.
-
cloneItemsetMinusItems
public java.util.List<java.lang.String> cloneItemsetMinusItems(java.util.List<java.lang.String> itemset, java.util.Map<java.lang.String,java.util.Set<java.lang.Integer>> mapSequenceID, double relativeMinsup)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 itemrelativeMinsup- the minimum support threshold chosen by the user.- Returns:
- a copy of this itemset except that item(s) with a support lower than minsup have been excluded.
-
-
DMelt 3.0 © DataMelt by jWork.ORG