ca.pfv.spmf.algorithms.sequentialpatterns.prefixSpan_AGP
Class AlgoPrefixSpan_AGP
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequentialpatterns.prefixSpan_AGP.AlgoPrefixSpan_AGP
-
public class AlgoPrefixSpan_AGP extends java.lang.ObjectThis is an implementation of the PrefixSpan algorithm by Antonio Gomariz Peñalver(AGP). PrefixSpan was proposed by Pei et al. 2001. This algorithm was inspired in the implementation of SPMF and, from it, I changed and optimized some things.
NOTE: This implementation saves the pattern to a file as soon as they are found or can keep the pattern into memory if no output path is provided by the user.
-
-
Constructor Summary
Constructors Constructor and Description AlgoPrefixSpan_AGP(double minsupRelative, AbstractionCreator creator)Standard constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()It clears all the attributes of AlgoPrefixSpan classdoublegetAbsoluteMinSupport()It gets the absolute minimum support, i.e.intgetNumberOfFrequentPatterns()Get the number of frequent patterns found.longgetRunningTime()It gets the time spent by the algoritm in its execution.java.lang.StringprintStatistics()Method to get the outlined information about the search for frequent sequences by means of PrefixSpan algorithm as a string.voidrunAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath)Method that starts the execution of the algorithm.
-
-
-
Constructor Detail
-
AlgoPrefixSpan_AGP
public AlgoPrefixSpan_AGP(double minsupRelative, AbstractionCreator creator)Standard constructor. It takes the minimum support threshold (from 1 up to 0) and an abstraction creator- Parameters:
minsupRelative- the relative minimum support thresholdcreator- the abstraction creator
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath) throws java.io.IOException
Method that starts the execution of the algorithm.- Parameters:
database- The original database in which we apply PrefixSpankeepPatterns- Flag indicating if the user want to keep the frequent patterns or he just want the amount of themverbose- Flag for debugging purposesoutputFilePath- Path pointing out to the file where the output, composed of frequent patterns, has to be kept. If, conversely, this parameter is null, we understand that the user wants the output in the main memory- Throws:
java.io.IOException
-
printStatistics
public java.lang.String printStatistics()
Method to get the outlined information about the search for frequent sequences by means of PrefixSpan algorithm as a string.- Returns:
- a string
-
getNumberOfFrequentPatterns
public int getNumberOfFrequentPatterns()
Get the number of frequent patterns found.- Returns:
- the number of frequent patterns.
-
getRunningTime
public long getRunningTime()
It gets the time spent by the algoritm in its execution.- Returns:
- the time spent (long).
-
getAbsoluteMinSupport
public double getAbsoluteMinSupport()
It gets the absolute minimum support, i.e. the minimum number of database sequences where a pattern has to appear- Returns:
- the minimum support (double)
-
clear
public void clear()
It clears all the attributes of AlgoPrefixSpan class
-
-
DMelt 3.0 © DataMelt by jWork.ORG