Package weka.associations
Class GeneralizedSequentialPatterns
- java.lang.Object
-
- weka.associations.AbstractAssociator
-
- weka.associations.GeneralizedSequentialPatterns
-
- All Implemented Interfaces:
java.io.Serializable
,java.lang.Cloneable
,Associator
,CapabilitiesHandler
,OptionHandler
,RevisionHandler
,TechnicalInformationHandler
public class GeneralizedSequentialPatterns extends AbstractAssociator implements OptionHandler, TechnicalInformationHandler
Class implementing a GSP algorithm for discovering sequential patterns in a sequential data set.
The attribute identifying the distinct data sequences contained in the set can be determined by the respective option. Furthermore, the set of output results can be restricted by specifying one or more attributes that have to be contained in each element/itemset of a sequence.
For further information see:
Ramakrishnan Srikant, Rakesh Agrawal (1996). Mining Sequential Patterns: Generalizations and Performance Improvements. BibTeX:@proceedings{Srikant1996, author = {Ramakrishnan Srikant and Rakesh Agrawal}, booktitle = {Advances in Database Technology EDBT '96}, publisher = {Springer}, title = {Mining Sequential Patterns: Generalizations and Performance Improvements}, year = {1996} }
Valid options are:-D If set, algorithm is run in debug mode and may output additional info to the console
-S <minimum support threshold> The miminum support threshold. (default: 0.9)
-I <attribute number representing the data sequence ID The attribute number representing the data sequence ID. (default: 0)
-F <attribute numbers used for result filtering The attribute numbers used for result filtering. (default: -1)
- Version:
- $Revision: 5504 $
- Author:
- Sebastian Beer
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description GeneralizedSequentialPatterns()
Constructor.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description void
buildAssociations(Instances data)
Extracts all sequential patterns out of a given sequential data set and prints out the results.java.lang.String
dataSeqIDTipText()
Returns the dataSeqID option tip text for the Weka GUI.java.lang.String
debugTipText()
Returns the tip text for this propertyvoid
extractFilterAttributes(java.lang.String attrNumbers)
Parses a given String containing attribute numbers which are used for result filtering.java.lang.String
filterAttributesTipText()
Returns the filterAttributes option tip text for the Weka GUI.java.lang.String
getAlgorithmStart()
Returns the time/date string the algorithm was startedCapabilities
getCapabilities()
Returns the Capabilities of the algorithm.java.lang.String
getCycleEnd()
Returns the time/date string the cycle endedjava.lang.String
getCycleStart()
Returns the time/date string the cycle was startedint
getDataSeqID()
Returns the attribute representing the data sequence ID.boolean
getDebug()
Get whether debugging is turned on.java.lang.String
getFilterAttributes()
Returns the String containing the attributes which are used for output filtering.double
getMinSupport()
Returns the minimum support threshold.java.lang.String[]
getOptions()
Returns an Array containing the current options settings.java.lang.String
getRevision()
Returns the revision string.TechnicalInformation
getTechnicalInformation()
Returns TechnicalInformation about the paper related to the algorithm.java.lang.String
globalInfo()
Returns global information about the algorithm.java.util.Enumeration
listOptions()
Returns an enumeration of the available options.static void
main(java.lang.String[] args)
Main method.java.lang.String
minSupportTipText()
Returns the minimum support option tip text for the Weka GUI.void
setDataSeqID(int value)
Sets the attribute representing the data sequence ID.void
setDebug(boolean value)
Set debugging mode.void
setFilterAttributes(java.lang.String value)
Sets the String containing the attributes which are used for output filtering.void
setMinSupport(double value)
Sets the minimum support threshold.void
setOptions(java.lang.String[] options)
Parses a given list of options.java.lang.String
toString()
Returns a String containing the result information of the algorithm.-
Methods inherited from class weka.associations.AbstractAssociator
forName, makeCopies, makeCopy
-
-
-
-
Method Detail
-
globalInfo
public java.lang.String globalInfo()
Returns global information about the algorithm.- Returns:
- the global information
-
getTechnicalInformation
public TechnicalInformation getTechnicalInformation()
Returns TechnicalInformation about the paper related to the algorithm.- Specified by:
getTechnicalInformation
in interfaceTechnicalInformationHandler
- Returns:
- the TechnicalInformation
-
listOptions
public java.util.Enumeration listOptions()
Returns an enumeration of the available options.- Specified by:
listOptions
in interfaceOptionHandler
- Returns:
- the available options
-
setOptions
public void setOptions(java.lang.String[] options) throws java.lang.Exception
Parses a given list of options. Valid options are:-D If set, algorithm is run in debug mode and may output additional info to the console
-S <minimum support threshold> The miminum support threshold. (default: 0.9)
-I <attribute number representing the data sequence ID The attribute number representing the data sequence ID. (default: 0)
-F <attribute numbers used for result filtering The attribute numbers used for result filtering. (default: -1)
- Specified by:
setOptions
in interfaceOptionHandler
- Parameters:
options
- the Array containing the options- Throws:
java.lang.Exception
- if an option is not supported
-
getOptions
public java.lang.String[] getOptions()
Returns an Array containing the current options settings.- Specified by:
getOptions
in interfaceOptionHandler
- Returns:
- the Array containing the settings
-
getCapabilities
public Capabilities getCapabilities()
Returns the Capabilities of the algorithm.- Specified by:
getCapabilities
in interfaceAssociator
- Specified by:
getCapabilities
in interfaceCapabilitiesHandler
- Overrides:
getCapabilities
in classAbstractAssociator
- Returns:
- the Capabilities
- See Also:
Capabilities
-
buildAssociations
public void buildAssociations(Instances data) throws java.lang.Exception
Extracts all sequential patterns out of a given sequential data set and prints out the results.- Specified by:
buildAssociations
in interfaceAssociator
- Parameters:
data
- the original data set- Throws:
java.lang.Exception
- if the associator has not been generated successfully
-
extractFilterAttributes
public void extractFilterAttributes(java.lang.String attrNumbers)
Parses a given String containing attribute numbers which are used for result filtering.- Parameters:
attrNumbers
- the String of attribute numbers
-
dataSeqIDTipText
public java.lang.String dataSeqIDTipText()
Returns the dataSeqID option tip text for the Weka GUI.- Returns:
- the option tip text
-
getDataSeqID
public int getDataSeqID()
Returns the attribute representing the data sequence ID.- Returns:
- the data sequence ID
-
setDataSeqID
public void setDataSeqID(int value)
Sets the attribute representing the data sequence ID.- Parameters:
value
- the data sequence ID to set
-
filterAttributesTipText
public java.lang.String filterAttributesTipText()
Returns the filterAttributes option tip text for the Weka GUI.- Returns:
- the option tip text
-
getFilterAttributes
public java.lang.String getFilterAttributes()
Returns the String containing the attributes which are used for output filtering.- Returns:
- the String containing the attributes
-
setFilterAttributes
public void setFilterAttributes(java.lang.String value)
Sets the String containing the attributes which are used for output filtering.- Parameters:
value
- the String containing the attributes
-
minSupportTipText
public java.lang.String minSupportTipText()
Returns the minimum support option tip text for the Weka GUI.- Returns:
- the option tip text
-
getMinSupport
public double getMinSupport()
Returns the minimum support threshold.- Returns:
- the minimum support threshold
-
setMinSupport
public void setMinSupport(double value)
Sets the minimum support threshold.- Parameters:
value
- the minimum support threshold
-
setDebug
public void setDebug(boolean value)
Set debugging mode.- Parameters:
value
- true if debug output should be printed
-
getDebug
public boolean getDebug()
Get whether debugging is turned on.- Returns:
- true if debugging output is on
-
debugTipText
public java.lang.String debugTipText()
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
getAlgorithmStart
public java.lang.String getAlgorithmStart()
Returns the time/date string the algorithm was started- Returns:
- the time and date the algorithm was started
-
getCycleStart
public java.lang.String getCycleStart()
Returns the time/date string the cycle was started- Returns:
- the time and date the cycle was started
-
getCycleEnd
public java.lang.String getCycleEnd()
Returns the time/date string the cycle ended- Returns:
- the time and date the cycle ended
-
toString
public java.lang.String toString()
Returns a String containing the result information of the algorithm.- Overrides:
toString
in classjava.lang.Object
- Returns:
- the String containing the result information
-
getRevision
public java.lang.String getRevision()
Returns the revision string.- Specified by:
getRevision
in interfaceRevisionHandler
- Overrides:
getRevision
in classAbstractAssociator
- Returns:
- the revision
-
main
public static void main(java.lang.String[] args)
Main method.- Parameters:
args
- commandline options, use -h for help
-
-