Documentation of 'ca.pfv.spmf.algorithms.sequentialpatterns.fournier2008_seqdim.Sequence' Java class
Sequence
ca.pfv.spmf.algorithms.sequentialpatterns.fournier2008_seqdim

Class Sequence



  • public class Sequence
    extends java.lang.Object
    Implementation of a sequence (a list of itemsets), which represents a sequential pattern or a sequence of a sequence database, as used by SeqDim and Fournier-Viger (2008) algorithms.
    See Also:
    AlgoSeqDim, AlgoFournierViger08
    • Constructor Summary

      Constructors 
      Constructor and Description
      Sequence(int id)
      Constructor.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method and Description
      void addItemset(Itemset itemset)
      Add an itemset to this sequence.
      Sequence cloneSequence()
      Make a copy of this sequence
      Sequence cloneSequenceMinusItems(java.util.Map<ItemSimple,java.util.Set<java.lang.Integer>> mapSequenceID, double relativeMinSup)
      Make a copy of a sequence minus a given item
      Itemset get(int index)
      Get the itemset at a given position in this sequence.
      int getAbsoluteSupport()
      Get the support of this sequential pattern as an integer value.
      int getId()
      Get the ID of this sequence.
      int getItemOccurencesTotalCount()
      Return the sum of the size of all itemsets of this sequence.
      java.util.List<Itemset> getItemsets()
      Get the list of itemsets in this sequence.
      ItemSimple getIthItem(int i)
      Get the ith item in this sequence.
      java.lang.String getRelativeSupportFormated(int databaseSize)
      Get the support of this itemset as a percentage (double value).
      java.util.Set<java.lang.Integer> getSequencesID()
      Get the sequence IDs containing this seq.
      long getTimeLength()
      Get the time length in terms of time units of this sequential pattern (is useful if timestamps are used, otherwise it is 0)
      java.lang.String itemsetsToString()
      Get a String representation of the itemsets in this Sequence.
      void print()
      Print this sequence to System.out.
      void setID(int id2)
      Set the ID of this squence.
      void setSequencesID(java.util.Set<java.lang.Integer> sequencesID)
      Set the sequence IDs containing this seq.
      int size()
      Get the size of this sequence (number of itemsets).
      int strictlyContains(Sequence sequence2)
      Check if this sequence contains another given sequence.
      java.lang.String toString()
      Return a string representation of this sequence.
      java.lang.String toStringShort()
      Return an abbreviated string representation of this sequence.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • Sequence

        public Sequence(int id)
        Constructor.
        Parameters:
        id - a sequence ID.
    • Method Detail

      • getRelativeSupportFormated

        public java.lang.String getRelativeSupportFormated(int databaseSize)
        Get the support of this itemset as a percentage (double value).
        Parameters:
        databaseSize - the number of sequences in the database.
        Returns:
        the support as a string with five decimals
      • getAbsoluteSupport

        public int getAbsoluteSupport()
        Get the support of this sequential pattern as an integer value.
        Returns:
        an integer.
      • addItemset

        public void addItemset(Itemset itemset)
        Add an itemset to this sequence.
        Parameters:
        itemset - An Itemset
      • cloneSequence

        public Sequence cloneSequence()
        Make a copy of this sequence
        Returns:
        a new Sequence
      • print

        public void print()
        Print this sequence to System.out.
      • toString

        public java.lang.String toString()
        Return a string representation of this sequence.
        Overrides:
        toString in class java.lang.Object
      • toStringShort

        public java.lang.String toStringShort()
        Return an abbreviated string representation of this sequence.
      • itemsetsToString

        public java.lang.String itemsetsToString()
        Get a String representation of the itemsets in this Sequence.
        Returns:
        a string
      • getId

        public int getId()
        Get the ID of this sequence.
        Returns:
        an integer.
      • getItemsets

        public java.util.List<Itemset> getItemsets()
        Get the list of itemsets in this sequence.
        Returns:
        the list of Itemset objects.
      • get

        public Itemset get(int index)
        Get the itemset at a given position in this sequence.
        Parameters:
        index - the position
        Returns:
        the Itemset
      • getIthItem

        public ItemSimple getIthItem(int i)
        Get the ith item in this sequence.
        Parameters:
        i - the position i
        Returns:
        an Item.
      • size

        public int size()
        Get the size of this sequence (number of itemsets).
        Returns:
        the size (an integer).
      • getSequencesID

        public java.util.Set<java.lang.Integer> getSequencesID()
        Get the sequence IDs containing this seq. pattern
        Returns:
        a Set of Integer
      • setSequencesID

        public void setSequencesID(java.util.Set<java.lang.Integer> sequencesID)
        Set the sequence IDs containing this seq. pattern.
        Parameters:
        sequencesID - a Set of Integer.
      • getItemOccurencesTotalCount

        public int getItemOccurencesTotalCount()
        Return the sum of the size of all itemsets of this sequence.
      • getTimeLength

        public long getTimeLength()
        Get the time length in terms of time units of this sequential pattern (is useful if timestamps are used, otherwise it is 0)
        Returns:
        the time length as a long.
      • strictlyContains

        public int strictlyContains(Sequence sequence2)
        Check if this sequence contains another given sequence.
        Parameters:
        sequence2 - a given sequence
        Returns:
        Return 1 if this sequence STRICTLY contains sequence Return 2 if this sequence is exactly the same as sequence2 Return 0 if this sequence does not contains sequence2.
      • cloneSequenceMinusItems

        public Sequence cloneSequenceMinusItems(java.util.Map<ItemSimple,java.util.Set<java.lang.Integer>> mapSequenceID,
                                                double relativeMinSup)
        Make a copy of a sequence minus a given item
        Parameters:
        mapSequenceID - a map indicating for each item (key) the IDs of sequences containing the item (value).
        relativeMinSup - a minimum support value (double)
        Returns:
        a new Sequence
      • setID

        public void setID(int id2)
        Set the ID of this squence.
        Parameters:
        id2 - a new ID.

DMelt 3.0 © DataMelt by jWork.ORG

You see the box below because you did not login.