ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP
Class AlgoCloSpan
- java.lang.Object
-
- ca.pfv.spmf.algorithms.sequentialpatterns.clospan_AGP.AlgoCloSpan
-
public class AlgoCloSpan extends java.lang.ObjectThis is an implementation of the CloSpan algorithm. CloSpan was proposed by X. Yan et al. 2003.
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 AlgoCloSpan(double minSupRelative, AbstractionCreator creator, boolean findClosedPatterns, boolean executePruningMethods)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()longgetRunningTime()It gets the total 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 CloSpan algorithm s a stringvoidrunAlgorithm(SequenceDatabase database, boolean keepPatterns, boolean verbose, java.lang.String outputFilePath)Method that starts the execution of the algorithm.
-
-
-
Constructor Detail
-
AlgoCloSpan
public AlgoCloSpan(double minSupRelative, AbstractionCreator creator, boolean findClosedPatterns, boolean executePruningMethods)Standard constructor. It takes the relative minimum support threshold (from 1 up to 0) and an abstraction creator- Parameters:
minSupRelative- the relative minimum support thresholdcreator- the abstraction creatorfindClosedPatterns- flag to indicate if we are interesting in only finding the closed sequences
-
-
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 CloSpan algorithm s a string- Returns:
- a string containing this information
-
getNumberOfFrequentPatterns
public int getNumberOfFrequentPatterns()
-
getRunningTime
public long getRunningTime()
It gets the total time spent by the algoritm in its execution.- Returns:
- the time
-
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
-
clear
public void clear()
It clears all the attributes of AlgoPrefixSpan class
-
-
DMelt 3.0 © DataMelt by jWork.ORG