Class Sequence

java.lang.Object
weka.associations.gsp.Sequence
All Implemented Interfaces:
Serializable, Cloneable, RevisionHandler

public class Sequence extends Object implements Cloneable, Serializable, RevisionHandler
Class representing a sequence of elements/itemsets.
Version:
$Revision: 1.2 $
Author:
Sebastian Beer
See Also:
  • Constructor Details

    • Sequence

      public Sequence()
      Constructor.
    • Sequence

      public Sequence(FastVector elements)
      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

      public static FastVector deleteInfrequentSequences(FastVector sequences, long minSupportCount)
      Deletes Sequences of a given set which don't meet the minimum support count threshold.
      Parameters:
      sequences - the set Sequences to be checked
      minSupportCount - the minimum support count
      Returns:
      the set of Sequences after deleting
    • oneElementsToSequences

      public static FastVector oneElementsToSequences(FastVector elements)
      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

      public static void printSetOfSequences(FastVector setOfSequences)
      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 Sequences
      dataSet - the corresponding data set containing the header information
      filterAttributes - the attributes to filter out
      Returns:
      the String representation
    • updateSupportCount

      public 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.
      Parameters:
      candidates - the set of candidates
      dataSequences - the set of data sequences
    • clone

      public Sequence clone()
      Returns a deep clone of a Sequence.
      Returns:
      the cloned Sequence
    • equals

      public boolean equals(Object obj)
      Checks if two Sequences are equal.
      Overrides:
      equals in class Object
      Returns:
      true, if the two Sequences are equal, else false
    • toNominalString

      public 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.
      Parameters:
      dataSet - the corresponding data set containing the header information
      Returns:
      the String representation
    • toString

      public String toString()
      Returns a String representation of a Sequence.
      Overrides:
      toString in class Object
      Returns:
      the String representation
    • getRevision

      public String getRevision()
      Returns the revision string.
      Specified by:
      getRevision in interface RevisionHandler
      Returns:
      the revision