Class SequentialPattern

  • All Implemented Interfaces:
    java.lang.Comparable<SequentialPattern>

    public class SequentialPattern
    extends java.lang.Object
    implements java.lang.Comparable<SequentialPattern>
    This class represents a sequential pattern. A sequential pattern is a list of itemsets. Copyright (c) 2008-2012 Philippe Fournier-Viger This file is part of the SPMF DATA MINING SOFTWARE (http://www.philippe-fournier-viger.com/spmf). SPMF is free software: you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, either version 3 of the License, or (at your option) any later version. SPMF is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with SPMF. If not, see .
    • Constructor Summary

      Constructors 
      Constructor Description
      SequentialPattern()
      Defaults constructor
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addItemset​(Itemset itemset)
      Add an itemset to this sequential pattern
      int compareTo​(SequentialPattern o)  
      Itemset get​(int index)
      Get an itemset at a given position.
      int getAbsoluteSupport()
      Get the absolute support of this pattern.
      java.util.List<Itemset> getItemsets()
      Get the itemsets in this sequential pattern
      java.lang.String getRelativeSupportFormated​(int sequencecount)
      Get the relative support of this pattern (a percentage)
      java.util.List<java.lang.Integer> getSequenceIDs()  
      java.lang.String itemsetsToString()
      Get a string representation of this sequential pattern.
      void print()
      Print this sequential pattern to System.out
      void setSequenceIDs​(java.util.List<java.lang.Integer> sequencesIds)
      Set the set of IDs of sequence containing this prefix
      int size()
      Get the number of itemsets in this sequential pattern.
      java.lang.String toString()
      Get a string representation of this sequential pattern, containing the sequence IDs of sequence containing this pattern.
      • Methods inherited from class java.lang.Object

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

      • SequentialPattern

        public SequentialPattern()
        Defaults constructor
    • Method Detail

      • setSequenceIDs

        public void setSequenceIDs​(java.util.List<java.lang.Integer> sequencesIds)
        Set the set of IDs of sequence containing this prefix
        Parameters:
        a - set of integer containing sequence IDs
      • getRelativeSupportFormated

        public java.lang.String getRelativeSupportFormated​(int sequencecount)
        Get the relative support of this pattern (a percentage)
        Parameters:
        sequencecount - the number of sequences in the original database
        Returns:
        the support as a string
      • getAbsoluteSupport

        public int getAbsoluteSupport()
        Get the absolute support of this pattern.
        Returns:
        the support (an integer >= 1)
      • addItemset

        public void addItemset​(Itemset itemset)
        Add an itemset to this sequential pattern
        Parameters:
        itemset - the itemset to be added
      • print

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

        public java.lang.String toString()
        Get a string representation of this sequential pattern, containing the sequence IDs of sequence containing this pattern.
        Overrides:
        toString in class java.lang.Object
      • itemsetsToString

        public java.lang.String itemsetsToString()
        Get a string representation of this sequential pattern.
      • getItemsets

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

        public Itemset get​(int index)
        Get an itemset at a given position.
        Parameters:
        index - the position
        Returns:
        the itemset
      • size

        public int size()
        Get the number of itemsets in this sequential pattern.
        Returns:
        the number of itemsets.
      • getSequenceIDs

        public java.util.List<java.lang.Integer> getSequenceIDs()