Class TestingHelper


  • public class TestingHelper
    extends Object
    Helper class for evaluating models on test data.
    Author:
    FracPete (fracpete at waikato dot ac dot nz)
    • Constructor Detail

      • TestingHelper

        public TestingHelper()
    • Method Detail

      • evaluateModel

        public static void evaluateModel​(weka.classifiers.Classifier model,
                                         weka.core.Instances test,
                                         weka.classifiers.Evaluation eval,
                                         int interval,
                                         TestingHelper.TestingUpdateListener listener)
                                  throws Exception
        Evaluates the model on the test data and sends updates to the listener (if available).
        Parameters:
        model - the model to test
        test - the test data
        eval - the evaluation object to use
        interval - the update interval
        listener - the listener to send the updates to, can be null
        Throws:
        Exception - if evaluation fails
      • evaluateModel

        public static void evaluateModel​(weka.classifiers.Classifier model,
                                         weka.core.Instances test,
                                         weka.classifiers.Evaluation eval,
                                         int interval,
                                         TestingHelper.TestingUpdateListener listener,
                                         adams.core.StoppableWithFeedback owner)
                                  throws Exception
        Evaluates the model on the test data and sends updates to the listener (if available).
        Parameters:
        model - the model to test
        test - the test data
        eval - the evaluation object to use
        interval - the update interval
        listener - the listener to send the updates to, can be null
        owner - the owner to check whether stopped, can be null
        Throws:
        Exception - if evaluation fails