Package weka.associations
Class AbstractAssociator
java.lang.Object
weka.associations.AbstractAssociator
- All Implemented Interfaces:
Serializable,Cloneable,Associator,CapabilitiesHandler,CapabilitiesIgnorer,CommandlineRunnable,OptionHandler,RevisionHandler
- Direct Known Subclasses:
Apriori,FPGrowth,SingleAssociatorEnhancer
public abstract class AbstractAssociator
extends Object
implements Cloneable, Associator, Serializable, CapabilitiesHandler, CapabilitiesIgnorer, RevisionHandler, OptionHandler, CommandlineRunnable
Abstract scheme for learning associations. All schemes for learning
associations implemement this class
- Version:
- $Revision: 15519 $
- Author:
- Eibe Frank (eibe@cs.waikato.ac.nz)
- See Also:
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionReturns the tip text for this propertystatic AssociatorCreates a new instance of a associator given it's class name and (optional) arguments to pass to it's setOptions method.Returns the Capabilities of this associator.booleanGet whether capabilities checking is turned off.String[]Gets the current settings of the associatorReturns the revision string.Returns an enumeration describing the available options.static Associator[]makeCopies(Associator model, int num) Creates copies of the current associator.static AssociatormakeCopy(Associator model) Creates a deep copy of the given associator using serialization.voidPerform any teardown stuff that might need to happen after execution.voidPerform any setup stuff that might need to happen before commandline execution.voidExecute the supplied object.static voidrunAssociator(Associator associator, String[] options) runs the associator with the given commandline optionsvoidsetDoNotCheckCapabilities(boolean doNotCheckCapabilities) Set whether not to check capabilities.voidsetOptions(String[] options) Parses a given list of options.Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface weka.associations.Associator
buildAssociations
-
Constructor Details
-
AbstractAssociator
public AbstractAssociator()
-
-
Method Details
-
listOptions
Returns an enumeration describing the available options.- Specified by:
listOptionsin interfaceOptionHandler- Returns:
- an enumeration of all the available options.
-
setOptions
Parses a given list of options.- Specified by:
setOptionsin interfaceOptionHandler- Parameters:
options- the list of options as an array of strings- Throws:
Exception- if an option is not supported
-
getOptions
Gets the current settings of the associator- Specified by:
getOptionsin interfaceOptionHandler- Returns:
- an array of strings suitable for passing to setOptions
-
doNotCheckCapabilitiesTipText
Returns the tip text for this property- Returns:
- tip text for this property suitable for displaying in the explorer/experimenter gui
-
setDoNotCheckCapabilities
public void setDoNotCheckCapabilities(boolean doNotCheckCapabilities) Set whether not to check capabilities.- Specified by:
setDoNotCheckCapabilitiesin interfaceCapabilitiesIgnorer- Parameters:
doNotCheckCapabilities- true if capabilities are not to be checked.
-
getDoNotCheckCapabilities
public boolean getDoNotCheckCapabilities()Get whether capabilities checking is turned off.- Specified by:
getDoNotCheckCapabilitiesin interfaceCapabilitiesIgnorer- Returns:
- true if capabilities checking is turned off.
-
forName
Creates a new instance of a associator given it's class name and (optional) arguments to pass to it's setOptions method. If the associator implements OptionHandler and the options parameter is non-null, the associator will have it's options set.- Parameters:
associatorName- the fully qualified class name of the associatoroptions- an array of options suitable for passing to setOptions. May be null.- Returns:
- the newly created associator, ready for use.
- Throws:
Exception- if the associator name is invalid, or the options supplied are not acceptable to the associator
-
makeCopy
Creates a deep copy of the given associator using serialization.- Parameters:
model- the associator to copy- Returns:
- a deep copy of the associator
- Throws:
Exception- if an error occurs
-
makeCopies
Creates copies of the current associator. Note that this method now uses Serialization to perform a deep copy, so the Associator object must be fully Serializable. Any currently built model will now be copied as well.- Parameters:
model- an example associator to copynum- the number of associators copies to create.- Returns:
- an array of associators.
- Throws:
Exception- if an error occurs
-
getCapabilities
Returns the Capabilities of this associator. Maximally permissive capabilities are allowed by default. Derived associators should override this method and first disable all capabilities and then enable just those capabilities that make sense for the scheme.- Specified by:
getCapabilitiesin interfaceAssociator- Specified by:
getCapabilitiesin interfaceCapabilitiesHandler- Returns:
- the capabilities of this object
- See Also:
-
getRevision
Returns the revision string.- Specified by:
getRevisionin interfaceRevisionHandler- Returns:
- the revision
-
runAssociator
runs the associator with the given commandline options- Parameters:
associator- the associator to runoptions- the commandline options
-
preExecution
Perform any setup stuff that might need to happen before commandline execution. Subclasses should override if they need to do something here- Specified by:
preExecutionin interfaceCommandlineRunnable- Throws:
Exception- if a problem occurs during setup
-
run
Execute the supplied object. Subclasses need to override this method.- Specified by:
runin interfaceCommandlineRunnable- Parameters:
toRun- the object to executeoptions- any options to pass to the object- Throws:
Exception- if a problem occurs
-
postExecution
Perform any teardown stuff that might need to happen after execution. Subclasses should override if they need to do something here- Specified by:
postExecutionin interfaceCommandlineRunnable- Throws:
Exception- if a problem occurs during teardown
-