Class WekaTrainAssociator

  • All Implemented Interfaces:
    AdditionalInformationHandler, CleanUpHandler, Destroyable, GlobalInfoSupporter, LoggingLevelHandler, LoggingSupporter, OptionHandler, QuickInfoSupporter, ShallowCopySupporter<Actor>, SizeOfHandler, Stoppable, StoppableWithFeedback, VariablesInspectionHandler, VariableChangeListener, Actor, ErrorHandler, InputConsumer, OutputProducer, JobRunnerSupporter, Serializable, Comparable

    public class WekaTrainAssociator
    extends AbstractTransformer
    implements JobRunnerSupporter
    Trains an associator based on the incoming dataset and outputs the built associator alongside the training header and rules (in a model container)..

    Input/output:
    - accepts:
       weka.core.Instances
    - generates:
       adams.flow.container.WekaAssociatorContainer


    Container information:
    - adams.flow.container.WekaAssociatorContainer: Model, Header, Dataset, Rules

    -logging-level <OFF|SEVERE|WARNING|INFO|CONFIG|FINE|FINER|FINEST> (property: loggingLevel)
        The logging level for outputting errors and debugging output.
        default: WARNING
        min-user-mode: Expert
     
    -name <java.lang.String> (property: name)
        The name of the actor.
        default: WekaTrainAssociator
     
    -annotation <adams.core.base.BaseAnnotation> (property: annotations)
        The annotations to attach to this actor.
        default:
     
    -skip <boolean> (property: skip)
        If set to true, transformation is skipped and the input token is just forwarded
        as it is.
        default: false
     
    -stop-flow-on-error <boolean> (property: stopFlowOnError)
        If set to true, the flow execution at this level gets stopped in case this
        actor encounters an error; the error gets propagated; useful for critical
        actors.
        default: false
        min-user-mode: Expert
     
    -silent <boolean> (property: silent)
        If enabled, then no errors are output in the console; Note: the enclosing
        actor handler must have this enabled as well.
        default: false
        min-user-mode: Expert
     
    -associator <adams.flow.core.CallableActorReference> (property: associator)
        The Weka associator to train on the input data.
        default: WekaAssociatorSetup
     
    -prefer-jobrunner <boolean> (property: preferJobRunner)
        If enabled, tries to offload the processing onto a adams.flow.standalone.JobRunnerInstance.
        default: false
     
    Author:
    fracpete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_ActualAssociator

        protected weka.associations.Associator m_ActualAssociator
        the actual weka associator.
      • m_PreferJobRunner

        protected boolean m_PreferJobRunner
        whether to offload training into a JobRunnerInstance.
      • m_JobRunnerInstance

        protected transient JobRunnerInstance m_JobRunnerInstance
        the JobRunnerInstance to use.
    • Constructor Detail

      • WekaTrainAssociator

        public WekaTrainAssociator()
    • Method Detail

      • setAssociator

        public void setAssociator​(CallableActorReference value)
        Sets the name of the callable associator to use.
        Parameters:
        value - the name
      • getAssociator

        public CallableActorReference getAssociator()
        Returns the name of the callable associator in use.
        Returns:
        the name
      • associatorTipText

        public String associatorTipText()
        Returns the tip text for this property.
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • setPreferJobRunner

        public void setPreferJobRunner​(boolean value)
        Sets whether to offload processing to a JobRunner instance if available.
        Specified by:
        setPreferJobRunner in interface JobRunnerSupporter
        Parameters:
        value - if true try to find/use a JobRunner instance
      • getPreferJobRunner

        public boolean getPreferJobRunner()
        Returns whether to offload processing to a JobRunner instance if available.
        Specified by:
        getPreferJobRunner in interface JobRunnerSupporter
        Returns:
        if true try to find/use a JobRunner instance
      • preferJobRunnerTipText

        public String preferJobRunnerTipText()
        Returns the tip text for this property.
        Specified by:
        preferJobRunnerTipText in interface JobRunnerSupporter
        Returns:
        tip text for this property suitable for displaying in the GUI or for listing the options.
      • accepts

        public Class[] accepts()
        Returns the class that the consumer accepts.
        Specified by:
        accepts in interface InputConsumer
        Returns:
        weka.core.Instances.class
      • generates

        public Class[] generates()
        Returns the class of objects that it generates.
        Specified by:
        generates in interface OutputProducer
        Returns:
        adams.flow.container.WekaAssociatorContainer.class
      • getAssociatorInstance

        protected weka.associations.Associator getAssociatorInstance()
                                                              throws Exception
        Returns an instance of the callable associator.
        Returns:
        the associator
        Throws:
        Exception - if fails to obtain associator
      • doExecute

        protected String doExecute()
        Executes the flow item.
        Specified by:
        doExecute in class AbstractActor
        Returns:
        null if everything is fine, otherwise error message