Class SequenceDatabase


  • public class SequenceDatabase
    extends java.lang.Object
    Inspired in SPMF. Implementation of a sequence database. Each sequence should have a unique id. See examples in /test/ directory for the format of input files. Copyright Antonio Gomariz PeƱalver 2013 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 .
    Author:
    agomariz
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void addSequence​(java.lang.String[] integers)
      Method that adds a sequence from a array of string
      void addSequence​(Sequence sequence)  
      void clear()  
      Trie frequentItems()
      Get the equivalence classes associated with the frequent items that we have found.
      java.util.Map<Item,​TrieNode> getFrequentItems()
      Get the map that makes the matching between items and equivalence classes
      java.util.List<Sequence> getSequences()  
      double loadFile​(java.lang.String path, double minSupport)
      Method that load a database from a path file given as parameter
      double loadFile​(java.util.ArrayList<java.lang.String> stringList, double minSupport)  
      int size()  
      java.lang.String toString()
      Get the string representation of this SequenceDatabase
      • Methods inherited from class java.lang.Object

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

      • SequenceDatabase

        public SequenceDatabase​(AbstractionCreator abstractionCreator,
                                IdListCreator IdListCreator)
        Standard constructor
        Parameters:
        abstractionCreator -
        IdListCreator -
    • Method Detail

      • loadFile

        public double loadFile​(java.util.ArrayList<java.lang.String> stringList,
                               double minSupport)
                        throws java.io.IOException
        Throws:
        java.io.IOException
      • loadFile

        public double loadFile​(java.lang.String path,
                               double minSupport)
                        throws java.io.IOException
        Method that load a database from a path file given as parameter
        Parameters:
        path - Path file where the database is
        minSupport - Minimum absolute support
        Throws:
        java.io.IOException
      • addSequence

        public void addSequence​(java.lang.String[] integers)
        Method that adds a sequence from a array of string
        Parameters:
        integers -
      • addSequence

        public void addSequence​(Sequence sequence)
      • toString

        public java.lang.String toString()
        Get the string representation of this SequenceDatabase
        Overrides:
        toString in class java.lang.Object
        Returns:
        the string representation
      • size

        public int size()
      • getSequences

        public java.util.List<Sequence> getSequences()
      • frequentItems

        public Trie frequentItems()
        Get the equivalence classes associated with the frequent items that we have found.
        Returns:
        the trie
      • getFrequentItems

        public java.util.Map<Item,​TrieNode> getFrequentItems()
        Get the map that makes the matching between items and equivalence classes
        Returns:
        the map
      • clear

        public void clear()