Package weka.associations

# Class GeneralizedSequentialPatterns

java.lang.Object
weka.associations.AbstractAssociator
weka.associations.GeneralizedSequentialPatterns

All Implemented Interfaces:
  `Serializable`, `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

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.
`String`
`dataSeqIDTipText()`
Returns the dataSeqID option tip text for the Weka GUI.
`String`
`debugTipText()`
Returns the tip text for this property
`void`
`extractFilterAttributes(String attrNumbers)`
Parses a given String containing attribute numbers which are used for result filtering.
`String`
`filterAttributesTipText()`
Returns the filterAttributes option tip text for the Weka GUI.
`String`
`getAlgorithmStart()`
Returns the time/date string the algorithm was started
`Capabilities`
`getCapabilities()`
Returns the Capabilities of the algorithm.
`String`
`getCycleEnd()`
Returns the time/date string the cycle ended
`String`
`getCycleStart()`
Returns the time/date string the cycle was started
`int`
`getDataSeqID()`
Returns the attribute representing the data sequence ID.
`boolean`
`getDebug()`
Get whether debugging is turned on.
`String`
`getFilterAttributes()`
Returns the String containing the attributes which are used for output filtering.
`double`
`getMinSupport()`
Returns the minimum support threshold.
`String[]`
`getOptions()`
Returns an Array containing the current options settings.
`String`
`getRevision()`
Returns the revision string.
`TechnicalInformation`
`getTechnicalInformation()`
Returns TechnicalInformation about the paper related to the algorithm.
`String`
`globalInfo()`
Returns global information about the algorithm.
`Enumeration`
`listOptions()`
Returns an enumeration of the available options.
`static void`
`main(String[] args)`
Main method.
`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(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(String[] options)`
Parses a given list of options.
`String`
`toString()`
Returns a String containing the result information of the algorithm.

### Methods inherited from class weka.associations.AbstractAssociator

`forName, makeCopies, makeCopy`

### Methods inherited from class java.lang.Object

`equals, getClass, hashCode, notify, notifyAll, wait, wait, wait`

## Constructor Details

### GeneralizedSequentialPatterns

public GeneralizedSequentialPatterns()
Constructor.

## Method Details

### globalInfo

public 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 interface `TechnicalInformationHandler`
Returns:
  the TechnicalInformation

### listOptions

public Enumeration listOptions()
Returns an enumeration of the available options.

Specified by:
  `listOptions` in interface `OptionHandler`
Returns:
  the available options

### setOptions

public void setOptions(String[] options) throws 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 interface `OptionHandler`
Parameters:
  `options` - the Array containing the options
Throws:
  `Exception` - if an option is not supported

### getOptions

public String[] getOptions()
Returns an Array containing the current options settings.

Specified by:
  `getOptions` in interface `OptionHandler`
Returns:
  the Array containing the settings

### getCapabilities

public Capabilities getCapabilities()
Returns the Capabilities of the algorithm.

Specified by:
  `getCapabilities` in interface `Associator`
Specified by:
  `getCapabilities` in interface `CapabilitiesHandler`
Overrides:
  `getCapabilities` in class `AbstractAssociator`
Returns:
  the Capabilities
See Also:
  - `Capabilities`

### buildAssociations

public void buildAssociations(Instances data) throws Exception
Extracts all sequential patterns out of a given sequential data set and prints out the results.

Specified by:
  `buildAssociations` in interface `Associator`
Parameters:
  `data` - the original data set
Throws:
  `Exception` - if the associator has not been generated successfully

### extractFilterAttributes

public void extractFilterAttributes(String attrNumbers)
Parses a given String containing attribute numbers which are used for result filtering.

Parameters:
  `attrNumbers` - the String of attribute numbers

### dataSeqIDTipText

public 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 String filterAttributesTipText()
Returns the filterAttributes option tip text for the Weka GUI.

Returns:
  the option tip text

### getFilterAttributes

public String getFilterAttributes()
Returns the String containing the attributes which are used for output filtering.

Returns:
  the String containing the attributes

### setFilterAttributes

public void setFilterAttributes(String value)
Sets the String containing the attributes which are used for output filtering.

Parameters:
  `value` - the String containing the attributes

### minSupportTipText

public 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 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 String getAlgorithmStart()
Returns the time/date string the algorithm was started

Returns:
  the time and date the algorithm was started

### getCycleStart

public String getCycleStart()
Returns the time/date string the cycle was started

Returns:
  the time and date the cycle was started

### getCycleEnd

public String getCycleEnd()
Returns the time/date string the cycle ended

Returns:
  the time and date the cycle ended

### toString

public String toString()
Returns a String containing the result information of the algorithm.

Overrides:
  `toString` in class `Object`
Returns:
  the String containing the result information

### getRevision

public String getRevision()
Returns the revision string.

Specified by:
  `getRevision` in interface `RevisionHandler`
Overrides:
  `getRevision` in class `AbstractAssociator`
Returns:
  the revision

### main

public static void main(String[] args)
Main method.

Parameters:
  `args` - commandline options, use -h for help