Class AbstractExperimentSetup

  • All Implemented Interfaces:
    adams.core.GlobalInfoSupporter, adams.core.logging.LoggingSupporter, adams.core.SizeOfHandler, adams.core.StatusMessageHandler, adams.core.Stoppable, adams.core.StoppableWithFeedback, Serializable
    Direct Known Subclasses:
    CrossValidationSetup, TrainTestSplitSetup

    public abstract class AbstractExperimentSetup
    extends AbstractEvaluation<ExperimentTab,​ResultItem>
    implements adams.core.StoppableWithFeedback
    Ancestor for experiment setups.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    See Also:
    Serialized Form
    • Field Detail

      • m_Stopped

        protected boolean m_Stopped
        whether the experiment got stopped.
    • Constructor Detail

      • AbstractExperimentSetup

        public AbstractExperimentSetup()
    • Method Detail

      • canExecute

        public abstract String canExecute​(weka.classifiers.Classifier classifier)
        Tests whether the experiment setup can be executed for the classifier.
        Parameters:
        classifier - the classifier to check
        Returns:
        null if successful, otherwise error message
      • init

        public abstract ResultItem init​(weka.classifiers.Classifier classifier)
                                 throws Exception
        Initializes the result item.
        Parameters:
        classifier - the current classifier
        Returns:
        the initialized history item
        Throws:
        Exception - if initialization fails
      • doExecute

        protected abstract void doExecute​(weka.classifiers.Classifier classifier,
                                          ResultItem item)
                                   throws Exception
        Executes the experiment setup for the classifier and updates the result item.
        Parameters:
        classifier - the current classifier
        item - the item to update
        Throws:
        Exception - if evaluation fails
      • postExecute

        protected abstract void postExecute​(weka.classifiers.Classifier classifier,
                                            ResultItem item)
        Hook method for after executing the experiment, e.g., cleaning up temp files.
        Parameters:
        classifier - the current classifier
        item - the item to update
      • execute

        public void execute​(weka.classifiers.Classifier classifier,
                            ResultItem item)
                     throws Exception
        Executes the experiment setup for the classifier and updates the result item.
        Parameters:
        classifier - the current classifier
        item - the item to update
        Throws:
        Exception - if evaluation fails
      • stopExecution

        public void stopExecution()
        Stops the execution.
        Specified by:
        stopExecution in interface adams.core.Stoppable
      • isStopped

        public boolean isStopped()
        Whether the execution has been stopped.
        Specified by:
        isStopped in interface adams.core.StoppableWithFeedback
        Returns:
        true if stopped
      • getSetups

        public static Class[] getSetups()
        Returns the available actions.
        Returns:
        the action classnames