Class ClassificationTester<S extends Observation,​T extends Category>

  • Type Parameters:
    S - type of observations
    T - type of categories
    Direct Known Subclasses:
    CrossValidator

    public abstract class ClassificationTester<S extends Observation,​T extends Category>
    extends java.lang.Object
    Classes implementing this interface provide the means to test a training mechanism for performance.
    Author:
    Matthias Thimm
    • Method Summary

      Modifier and Type Method Description
      double test​(Classifier classifier, TrainingSet<S,​T> trainingSet)
      Measures the performance of the given classifier on the given test set, i.e.
      abstract double test​(Trainer<S,​T> trainer, TrainingSet<S,​T> trainingSet)
      This methods takes a trainer and a training set and returns the performance (in [0,1]) of the trained classifier on the training set (e.g.
      • Methods inherited from class java.lang.Object

        equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Constructor Detail

      • ClassificationTester

        public ClassificationTester()
    • Method Detail

      • test

        public abstract double test​(Trainer<S,​T> trainer,
                                    TrainingSet<S,​T> trainingSet)
        This methods takes a trainer and a training set and returns the performance (in [0,1]) of the trained classifier on the training set (e.g. using cross-validation). The larger the value the better the trained classifier.
        Parameters:
        trainer - some trainer
        trainingSet - some training set
        Returns:
        the performance of the trained classifier
      • test

        public double test​(Classifier classifier,
                           TrainingSet<S,​T> trainingSet)
        Measures the performance of the given classifier on the given test set, i.e. every observation from the training set is classified by the classifier and its prediction is compared with the provided category. The return value is the ratio of the correctly classified observations and the total number of observations.
        Parameters:
        classifier - some classifier.
        trainingSet - some training set.
        Returns:
        the performance of the given classifier