ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP
Class AlgoSPAM_AGP
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequentialpatterns.spade_spam_AGP.AlgoSPAM_AGP
-
public class AlgoSPAM_AGP extends java.lang.ObjectThis is an implementation of the SPAM algorithm. SPAM was proposed by Ayres in 2002.
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 AlgoSPAM_AGP(double minsupRelative)Constructor of the class that calls SPAM algorithm.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method and Description voidclear()It clears all the attributes of AlgoSpam classdoublegetMinSupRelative()It gets the minimum relative support, i.e.intgetNumberOfFrequentPatterns()longgetRunningTime()It gets the time spent by the algoritm in its execution.java.lang.StringprintStatistics()voidrunAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath)Actual call to SPAM algorithm.
-
-
-
Constructor Detail
-
AlgoSPAM_AGP
public AlgoSPAM_AGP(double minsupRelative)
Constructor of the class that calls SPAM algorithm.- Parameters:
minsupRelative- Minimum support (from 0 up to 1)
-
-
Method Detail
-
runAlgorithm
public void runAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath) throws java.io.IOException
Actual call to SPAM algorithm. The output can be either kept or ignore. Whenever we choose to keep the patterns found, we can keep them in a file or in the main memory- Parameters:
database- Original database in where we want to search for the frequent patterns.keepPatterns- Flag indicating if we want to keep the output or notverbose- Flag for debugging purposesoutputFilePath- Path of the file in which we want to store the frequent patterns. If this value is null, we keep the patterns in the main memory. This argument is taken into account just when keepPatterns is activated.- Throws:
java.io.IOException
-
printStatistics
public java.lang.String printStatistics()
-
getNumberOfFrequentPatterns
public int getNumberOfFrequentPatterns()
-
getRunningTime
public long getRunningTime()
It gets the time spent by the algoritm in its execution.- Returns:
- the total time
-
getMinSupRelative
public double getMinSupRelative()
It gets the minimum relative support, i.e. the minimum number of database sequences where a pattern has to appear- Returns:
- the minimum support
-
clear
public void clear()
It clears all the attributes of AlgoSpam class
-
-
DMelt 3.0 © DataMelt by jWork.ORG