Class AbstractAssociator

All Implemented Interfaces:
Serializable, Cloneable, Associator, CapabilitiesHandler, CapabilitiesIgnorer, CommandlineRunnable, OptionHandler, RevisionHandler
Direct Known Subclasses:
Apriori, FPGrowth, SingleAssociatorEnhancer

Abstract scheme for learning associations. All schemes for learning associations implemement this class
$Revision: 15519 $
Eibe Frank (
See Also:
  • Constructor Details

    • AbstractAssociator

      public AbstractAssociator()
  • Method Details

    • listOptions

      public Enumeration<Option> listOptions()
      Returns an enumeration describing the available options.
      Specified by:
      listOptions in interface OptionHandler
      an enumeration of all the available options.
    • setOptions

      public void setOptions(String[] options) throws Exception
      Parses a given list of options.
      Specified by:
      setOptions in interface OptionHandler
      options - the list of options as an array of strings
      Exception - if an option is not supported
    • getOptions

      public String[] getOptions()
      Gets the current settings of the associator
      Specified by:
      getOptions in interface OptionHandler
      an array of strings suitable for passing to setOptions
    • doNotCheckCapabilitiesTipText

      public String doNotCheckCapabilitiesTipText()
      Returns the tip text for this property
      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:
      setDoNotCheckCapabilities in interface CapabilitiesIgnorer
      doNotCheckCapabilities - true if capabilities are not to be checked.
    • getDoNotCheckCapabilities

      public boolean getDoNotCheckCapabilities()
      Get whether capabilities checking is turned off.
      Specified by:
      getDoNotCheckCapabilities in interface CapabilitiesIgnorer
      true if capabilities checking is turned off.
    • forName

      public static Associator forName(String associatorName, String[] options) throws Exception
      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.
      associatorName - the fully qualified class name of the associator
      options - an array of options suitable for passing to setOptions. May be null.
      the newly created associator, ready for use.
      Exception - if the associator name is invalid, or the options supplied are not acceptable to the associator
    • makeCopy

      public static Associator makeCopy(Associator model) throws Exception
      Creates a deep copy of the given associator using serialization.
      model - the associator to copy
      a deep copy of the associator
      Exception - if an error occurs
    • makeCopies

      public static Associator[] makeCopies(Associator model, int num) throws Exception
      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.
      model - an example associator to copy
      num - the number of associators copies to create.
      an array of associators.
      Exception - if an error occurs
    • getCapabilities

      public Capabilities 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:
      getCapabilities in interface Associator
      Specified by:
      getCapabilities in interface CapabilitiesHandler
      the capabilities of this object
      See Also:
    • getRevision

      public String getRevision()
      Returns the revision string.
      Specified by:
      getRevision in interface RevisionHandler
      the revision
    • runAssociator

      public static void runAssociator(Associator associator, String[] options)
      runs the associator with the given commandline options
      associator - the associator to run
      options - the commandline options
    • preExecution

      public void preExecution() throws Exception
      Perform any setup stuff that might need to happen before commandline execution. Subclasses should override if they need to do something here
      Specified by:
      preExecution in interface CommandlineRunnable
      Exception - if a problem occurs during setup
    • run

      public void run(Object toRun, String[] options) throws Exception
      Execute the supplied object. Subclasses need to override this method.
      Specified by:
      run in interface CommandlineRunnable
      toRun - the object to execute
      options - any options to pass to the object
      Exception - if a problem occurs
    • postExecution

      public void postExecution() throws Exception
      Perform any teardown stuff that might need to happen after execution. Subclasses should override if they need to do something here
      Specified by:
      postExecution in interface CommandlineRunnable
      Exception - if a problem occurs during teardown