Class WekaCrossValidationJob

    • Field Detail

      • m_Classifier

        protected weka.classifiers.Classifier m_Classifier
        the classifier to evaluate.
      • m_Fold

        protected int m_Fold
        the fold.
      • m_Train

        protected weka.core.Instances m_Train
        the training set.
      • m_Test

        protected weka.core.Instances m_Test
        the test set.
      • m_DiscardPredictions

        protected boolean m_DiscardPredictions
        whether to discard the predictions.
      • m_Evaluation

        protected weka.classifiers.Evaluation m_Evaluation
        the evaluation.
      • m_StatusMessageHandler

        protected transient StatusMessageHandler m_StatusMessageHandler
        for outputting notifications.
      • m_FlowContext

        protected transient Actor m_FlowContext
        the flow context.
    • Constructor Detail

      • WekaCrossValidationJob

        public WekaCrossValidationJob​(weka.classifiers.Classifier classifier,
                                      weka.core.Instances train,
                                      weka.core.Instances test,
                                      int fold,
                                      boolean discardPred)
        Initializes the job.
        Parameters:
        classifier - the classifier to evaluate
        train - the training set
        test - the test set
        fold - the fold index
        discardPred - whether to discard the predictions
      • WekaCrossValidationJob

        public WekaCrossValidationJob​(weka.classifiers.Classifier classifier,
                                      weka.core.Instances train,
                                      weka.core.Instances test,
                                      int fold,
                                      boolean discardPred,
                                      StatusMessageHandler handler)
        Initializes the job.
        Parameters:
        classifier - the classifier to evaluate
        train - the training set
        test - the test set
        fold - the fold index
        discardPred - whether to discard the predictions
        handler - for displaying notifications, can be null
    • Method Detail

      • getFlowContext

        public Actor getFlowContext()
        Returns the flow context, if any.
        Specified by:
        getFlowContext in interface FlowContextHandler
        Returns:
        the actor, null if none available
      • getTrain

        public weka.core.Instances getTrain()
        Returns the training set.
        Returns:
        the dataset
      • getTest

        public weka.core.Instances getTest()
        Returns the test set.
        Returns:
        the dataset
      • getFold

        public int getFold()
        Returns the fold index.
        Returns:
        the fold
      • getDiscardPredictions

        public boolean getDiscardPredictions()
        Returns whether the predictions are discarded.
        Returns:
        true if discarded
      • getStatusMessageHandler

        public StatusMessageHandler getStatusMessageHandler()
        Returns the status message handler.
        Returns:
        the handler
      • getEvaluation

        public weka.classifiers.Evaluation getEvaluation()
        Returns the generated evaluation object.
        Returns:
        the evaluation, null if not available
      • getClassifier

        public weka.classifiers.Classifier getClassifier()
        Returns the classifier (should be built after the job finished).
        Returns:
        the classifier
      • preProcessCheck

        protected String preProcessCheck()
        Description copied from class: AbstractJob
        Checks whether all pre-conditions have been met.
        Specified by:
        preProcessCheck in class AbstractJob
        Returns:
        null if everything is OK, otherwise an error message
      • process

        protected void process()
                        throws Exception
        Does the actual execution of the job.
        Specified by:
        process in class AbstractJob
        Throws:
        Exception - if fails to execute job
      • postProcessCheck

        protected String postProcessCheck()
        Checks whether all post-conditions have been met.
        Specified by:
        postProcessCheck in class AbstractJob
        Returns:
        null if everything is OK, otherwise an error message
      • cleanUp

        public void cleanUp()
        Cleans up data structures, frees up memory. Removes dependencies and job parameters.
        Specified by:
        cleanUp in interface CleanUpHandler
        Specified by:
        cleanUp in interface Job
        Overrides:
        cleanUp in class AbstractJob
      • toString

        public String toString()
        Returns a string representation of this job.
        Specified by:
        toString in class AbstractJob
        Returns:
        the job as string