Package weka.associations.gsp
Class Sequence
java.lang.Object
weka.associations.gsp.Sequence
- All Implemented Interfaces:
Serializable
,Cloneable
,RevisionHandler
Class representing a sequence of elements/itemsets.
- Version:
- $Revision: 1.2 $
- Author:
- Sebastian Beer
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionSequence()
Constructor.Sequence
(int supportCount) Constructor accepting an int value as parameter to set the support count.Sequence
(FastVector elements) Constructor accepting a set of elements as parameter. -
Method Summary
Modifier and TypeMethodDescriptionstatic FastVector
aprioriGen
(FastVector kMinusOneSequences) Generates all possible candidate k-Sequences and prunes the ones that contain an infrequent (k-1)-Sequence.clone()
Returns a deep clone 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
Checks if two Sequences are equal.Returns the revision string.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.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.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.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.
-
Constructor Details
-
Sequence
public Sequence()Constructor. -
Sequence
Constructor accepting a set of elements as parameter.- Parameters:
elements
- the Elements of the Sequence
-
Sequence
public Sequence(int supportCount) Constructor accepting an int value as parameter to set the support count.- Parameters:
supportCount
- the support count to set
-
-
Method Details
-
aprioriGen
public static FastVector aprioriGen(FastVector kMinusOneSequences) throws CloneNotSupportedException Generates all possible candidate k-Sequences and prunes the ones that contain an infrequent (k-1)-Sequence.- Parameters:
kMinusOneSequences
- the set of (k-1)-Sequences, used for verification- Returns:
- the generated set of k-candidates
- Throws:
CloneNotSupportedException
-
deleteInfrequentSequences
Deletes Sequences of a given set which don't meet the minimum support count threshold.- Parameters:
sequences
- the set Sequences to be checkedminSupportCount
- the minimum support count- Returns:
- the set of Sequences after deleting
-
oneElementsToSequences
Converts a set of 1-Elements into a set of 1-Sequences.- Parameters:
elements
- the set of 1-Elements- Returns:
- the set of 1-Sequences
-
printSetOfSequences
Prints a set of Sequences as String output.- Parameters:
setOfSequences
- the set of sequences
-
setOfSequencesToString
public 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.- Parameters:
setOfSequences
- the set of SequencesdataSet
- the corresponding data set containing the header informationfilterAttributes
- the attributes to filter out- Returns:
- the String representation
-
updateSupportCount
Updates the support count of a set of Sequence candidates according to a given set of data sequences.- Parameters:
candidates
- the set of candidatesdataSequences
- the set of data sequences
-
clone
Returns a deep clone of a Sequence.- Returns:
- the cloned Sequence
-
equals
Checks if two Sequences are equal. -
toNominalString
Returns a String representation of a Sequences where the numeric value of each event/item is represented by its respective nominal value.- Parameters:
dataSet
- the corresponding data set containing the header information- Returns:
- the String representation
-
toString
Returns a String representation of a Sequence. -
getRevision
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Returns:
- the revision
-