public class Sequence extends Object implements Cloneable, Serializable, RevisionHandler
Modifier and Type | Field and Description |
---|---|
protected FastVector |
m_Elements
ordered list of the comprised elements/itemsets
|
protected int |
m_SupportCount
the support count of the Sequence
|
Constructor and Description |
---|
Sequence()
Constructor.
|
Sequence(FastVector elements)
Constructor accepting a set of elements as parameter.
|
Sequence(int supportCount)
Constructor accepting an int value as parameter to set the support count.
|
Modifier and Type | Method and Description |
---|---|
static FastVector |
aprioriGen(FastVector kMinusOneSequences)
Generates all possible candidate k-Sequences and prunes the ones that
contain an infrequent (k-1)-Sequence.
|
Sequence |
clone()
Returns a deep clone of a Sequence.
|
protected Sequence |
deleteEvent(String position)
Deletes either the first or the last event/item of a Sequence.
|
static FastVector |
deleteInfrequentSequences(FastVector sequences,
long minSupportCount)
Deletes Sequences of a given set which don't meet the minimum support
count threshold.
|
boolean |
equals(Object obj)
Checks if two Sequences are equal.
|
protected static FastVector |
generateKCandidates(FastVector kMinusOneSequences)
Generates candidate k-Sequences on the basis of a given (k-1)-Sequence set.
|
protected FastVector |
getElements()
Returns the Elements of the Sequence.
|
String |
getRevision()
Returns the revision string.
|
protected int |
getSupportCount()
Returns the support count of the Sequence.
|
protected boolean |
isSubsequenceOf(Instances dataSequence)
Checks if the Sequence is subsequence of a given data sequence.
|
protected static FastVector |
merge(Sequence seq1,
Sequence seq2,
boolean oneElements,
boolean mergeElements)
Merges two Sequences in the course of candidate generation.
|
static FastVector |
oneElementsToSequences(FastVector elements)
Converts a set of 1-Elements into a set of 1-Sequences.
|
static void |
printSetOfSequences(FastVector setOfSequences)
Prints a set of Sequences as String output.
|
protected static FastVector |
pruneCadidates(FastVector allCandidates,
FastVector kMinusOneSequences)
Prunes a k-Sequence of a given candidate set if one of its (k-1)-Sequences
is infrequent.
|
protected void |
setElements(FastVector elements)
Sets the Elements of the Sequence.
|
static String |
setOfSequencesToString(FastVector setOfSequences,
Instances dataSet,
FastVector filterAttributes)
Returns a String representation of a set of Sequences where the numeric
value of each event/item is represented by its respective nominal value.
|
protected void |
setSupportCount(int supportCount)
Sets the support count of the Sequence.
|
String |
toNominalString(Instances dataSet)
Returns a String representation of a Sequences where the numeric value
of each event/item is represented by its respective nominal value.
|
String |
toString()
Returns a String representation of a Sequence.
|
static void |
updateSupportCount(FastVector candidates,
FastVector dataSequences)
Updates the support count of a set of Sequence candidates according to a
given set of data sequences.
|
protected int m_SupportCount
protected FastVector m_Elements
public Sequence()
public Sequence(FastVector elements)
elements
- the Elements of the Sequencepublic Sequence(int supportCount)
supportCount
- the support count to setpublic static FastVector aprioriGen(FastVector kMinusOneSequences) throws CloneNotSupportedException
kMinusOneSequences
- the set of (k-1)-Sequences, used for verificationCloneNotSupportedException
public static FastVector deleteInfrequentSequences(FastVector sequences, long minSupportCount)
sequences
- the set Sequences to be checkedminSupportCount
- the minimum support countprotected static FastVector generateKCandidates(FastVector kMinusOneSequences) throws CloneNotSupportedException
kMinusOneSequences
- the set of (k-1)-SequencesCloneNotSupportedException
protected static FastVector merge(Sequence seq1, Sequence seq2, boolean oneElements, boolean mergeElements)
seq1
- Sequence at first positionseq2
- Sequence at second positiononeElements
- true, if 1-Elements should be merged, else falsemergeElements
- true, if two 1-Elements were not already merged
(regardless of their position), else falsepublic static FastVector oneElementsToSequences(FastVector elements)
elements
- the set of 1-Elementspublic static void printSetOfSequences(FastVector setOfSequences)
setOfSequences
- the set of sequencesprotected static FastVector pruneCadidates(FastVector allCandidates, FastVector kMinusOneSequences)
allCandidates
- the set of all potential k-SequenceskMinusOneSequences
- the set of (k-1)-Sequences for verificationpublic static String setOfSequencesToString(FastVector setOfSequences, Instances dataSet, FastVector filterAttributes)
setOfSequences
- the set of SequencesdataSet
- the corresponding data set containing the header
informationfilterAttributes
- the attributes to filter outpublic static void updateSupportCount(FastVector candidates, FastVector dataSequences)
candidates
- the set of candidatesdataSequences
- the set of data sequencespublic Sequence clone()
protected Sequence deleteEvent(String position)
position
- the position of the event/item (first or last)public boolean equals(Object obj)
protected FastVector getElements()
protected int getSupportCount()
protected boolean isSubsequenceOf(Instances dataSequence)
dataSequence
- the data sequence to verify againstprotected void setElements(FastVector elements)
elements
- the Elements to setprotected void setSupportCount(int supportCount)
supportCount
- the support count to setpublic String toNominalString(Instances dataSet)
dataSet
- the corresponding data set containing the header
informationpublic String toString()
public String getRevision()
getRevision
in interface RevisionHandler
Copyright © 2015 University of Waikato, Hamilton, NZ. All rights reserved.