Class AbstractPredictor

    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      int extractPredictedClass​(de.jungblut.math.DoubleVector predict)
      Given an already done prediction, choose the class.
      int extractPredictedClass​(de.jungblut.math.DoubleVector predict, double threshold)
      Given an already done prediction, choose the class with a threshold.
      int predictedClass​(de.jungblut.math.DoubleVector features)
      Classifies the given features.
      int predictedClass​(de.jungblut.math.DoubleVector features, double threshold)
      Classifies the given features.
      de.jungblut.math.DoubleVector predictProbability​(de.jungblut.math.DoubleVector features)
      Classifies the given features.
      • Methods inherited from class java.lang.Object

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

      • AbstractPredictor

        public AbstractPredictor()
    • Method Detail

      • predictedClass

        public int predictedClass​(de.jungblut.math.DoubleVector features,
                                  double threshold)
        Description copied from interface: Predictor
        Classifies the given features.
        Specified by:
        predictedClass in interface Predictor
        threshold - the threshold for the prediction "probability". In the sigmoid and binary case, you want to set everything greater (>) 0.5 to 1d and everything below (<=) to 0d.
        Returns:
        the predicted class as an integer for the output of a classifier.
      • predictedClass

        public int predictedClass​(de.jungblut.math.DoubleVector features)
        Description copied from interface: Predictor
        Classifies the given features.
        Specified by:
        predictedClass in interface Predictor
        Returns:
        the predicted class as an integer for the output of a classifier.
      • predictProbability

        public de.jungblut.math.DoubleVector predictProbability​(de.jungblut.math.DoubleVector features)
        Description copied from interface: Predictor
        Classifies the given features.
        Specified by:
        predictProbability in interface Predictor
        Returns:
        a vector that returns the probability of all outcomes. The output vector should sum to one.
      • extractPredictedClass

        public int extractPredictedClass​(de.jungblut.math.DoubleVector predict)
        Description copied from interface: Predictor
        Given an already done prediction, choose the class.
        Specified by:
        extractPredictedClass in interface Predictor
        Returns:
        the class index as integer.
      • extractPredictedClass

        public int extractPredictedClass​(de.jungblut.math.DoubleVector predict,
                                         double threshold)
        Description copied from interface: Predictor
        Given an already done prediction, choose the class with a threshold.
        Specified by:
        extractPredictedClass in interface Predictor
        Returns:
        the class index as integer.