ca.pfv.spmf.algorithms.sequentialpatterns.gsp_AGP
Class AlgoGSP
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequentialpatterns.gsp_AGP.AlgoGSP
-
public class AlgoGSP extends java.lang.ObjectThis is an implementation of the GSP algorithm. GSP was proposed by Srikant and Agrawal 1996.
NOTE: This implementation saves the patterns to a file as soon as a level of patterns is found or can keep the patterns into memory if no output path is provided by the user.
-
-
Constructor Summary
Constructors Constructor and Description AlgoGSP(double minSupRelative, double mingap, double maxgap, double windowSize, AbstractionCreator abstractionCreator)Constructor for GSP algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()It cleans the most important attributes.doublegetMinSupAbsolut()Return the absolute minimum support, i.e.intgetNumberOfFrequentPatterns()java.lang.StringgetPatterns()java.lang.StringprintedOutputToSaveInFile()Method to print some statistics about the execution.java.lang.StringprintStatistics()Method to print some statistics about the execution.SequencesrunAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath)Method that runs the GSP algorithm in the database given as parameter.longrunningTime()Time that GSP takes completing the execution
-
-
-
Constructor Detail
-
AlgoGSP
public AlgoGSP(double minSupRelative, double mingap, double maxgap, double windowSize, AbstractionCreator abstractionCreator)Constructor for GSP algorithm. It initializes most of the class' attributes.
-
-
Method Detail
-
runAlgorithm
public Sequences runAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath) throws java.io.IOException
Method that runs the GSP algorithm in the database given as parameter.- Parameters:
database- a sequence databasekeepPatterns- flag activated if we want to keep the resulting patterns or notverbose- flat activated for debugging purposesoutputFilePath- an output file path- Returns:
- the frequent sequences found in the original database
- Throws:
java.io.IOException
-
printStatistics
public java.lang.String printStatistics()
Method to print some statistics about the execution. It uses the standard format.- Returns:
- a String with the information in it.
-
printedOutputToSaveInFile
public java.lang.String printedOutputToSaveInFile()
Method to print some statistics about the execution. It uses the optional format.- Returns:
- a String with the information in it
-
getNumberOfFrequentPatterns
public int getNumberOfFrequentPatterns()
- Returns:
- The number of frequent sequences found by GSP in the last execution
-
getPatterns
public java.lang.String getPatterns()
- Returns:
- the frequent patterns found by the last execution of GSP. It only works under a Save_To_Memory option.
-
runningTime
public long runningTime()
Time that GSP takes completing the execution- Returns:
- the runtime as a long
-
getMinSupAbsolut
public double getMinSupAbsolut()
Return the absolute minimum support, i.e. the minimum number of sequences where a patter must appear- Returns:
- the minsup value
-
clear
public void clear()
It cleans the most important attributes.
-
-
DMelt 3.0 © DataMelt by jWork.ORG