public class AlgoPrefixSpan
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
class |
AlgoPrefixSpan.MapFrequentPairs
This class contains two maps, which are used for counting the
frequencies of items, whether in a postfix itemset or a normal itemset.
|
Constructor and Description |
---|
AlgoPrefixSpan()
Default constructor
|
Modifier and Type | Method and Description |
---|---|
protected AlgoPrefixSpan.MapFrequentPairs |
findAllFrequentPairs(java.util.List<PseudoSequence> sequences,
int lastBufferPosition)
Method to find all frequent items in a projected sequence database
|
protected java.util.Map<java.lang.Integer,java.util.List<PseudoSequence>> |
findAllFrequentPairsSingleItems(java.util.List<PseudoSequence> sequences,
int lastBufferPosition)
Method to find all frequent items in a projected sequence database
|
int |
getMaximumPatternLength()
Get the maximum length of patterns to be found (in terms of item count)
|
void |
printStatistics()
Print statistics about the algorithm execution to System.out.
|
SequentialPatterns |
runAlgorithm(PatternSequenceDatabase patternSequenceDatabase,
double minsupRelative)
Run the algorithm
|
SequentialPatterns |
runAlgorithm(PatternSequenceDatabase patternSequenceDatabase,
int minsup)
Run the algorithm
|
void |
setMaximumPatternLength(int maximumPatternLength)
Set the maximum length of patterns to be found (in terms of item count)
|
void |
setShowSequenceIdentifiers(boolean showSequenceIdentifiers)
Set that the sequence identifiers should be shown (true) or not (false) for each
pattern found
|
public SequentialPatterns runAlgorithm(PatternSequenceDatabase patternSequenceDatabase, double minsupRelative) throws java.io.IOException
patternSequenceDatabase
- : a sequence databaseminsupRelative
- : the minimum support as a percentage (e.g. 50%) as a value in [0,1]java.io.IOException
- exception if error while writing the filepublic SequentialPatterns runAlgorithm(PatternSequenceDatabase patternSequenceDatabase, int minsup) throws java.io.IOException
database
- : a sequence databaseminsupPercent
- : the minimum support as an integeroutputFilePath
- : the path of the output file to save the result
or null if you want the result to be saved into memoryjava.io.IOException
- exception if error while writing the fileprotected java.util.Map<java.lang.Integer,java.util.List<PseudoSequence>> findAllFrequentPairsSingleItems(java.util.List<PseudoSequence> sequences, int lastBufferPosition)
sequences
- the set of sequencespatternBuffer
- the current sequential pattern that we want to try to growlastBufferPosition
- the last position used in the buffer for storing the current prefixprotected AlgoPrefixSpan.MapFrequentPairs findAllFrequentPairs(java.util.List<PseudoSequence> sequences, int lastBufferPosition)
sequences
- the set of sequenceslastBufferPosition
- the last position used in the buffer for storing the current prefixpublic void printStatistics()
size
- the size of the databasepublic int getMaximumPatternLength()
public void setMaximumPatternLength(int maximumPatternLength)
maximumPatternLength
- the maximumPatternLength to setpublic void setShowSequenceIdentifiers(boolean showSequenceIdentifiers)
showSequenceIdentifiers
- true or false