Interface Predictor

    • Method Summary

      All Methods Instance Methods Abstract Methods Default Methods 
      Modifier and Type Method Description
      default Classifier asClassifier()
      Backward compatibility method to make online-ml project's predictors work with almost everything in this library.
      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.
      de.jungblut.math.DoubleVector predict​(de.jungblut.math.DoubleVector features)
      Classifies the given features.
      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.
    • Method Detail

      • predict

        de.jungblut.math.DoubleVector predict​(de.jungblut.math.DoubleVector features)
        Classifies the given features.
        Returns:
        the vector that contains an indicator at the index of the class. Usually zero or 1, in some cases it is a probability or activation value.
      • predictProbability

        de.jungblut.math.DoubleVector predictProbability​(de.jungblut.math.DoubleVector features)
        Classifies the given features.
        Returns:
        a vector that returns the probability of all outcomes. The output vector should sum to one.
      • predictedClass

        int predictedClass​(de.jungblut.math.DoubleVector features,
                           double threshold)
        Classifies the given features.
        Parameters:
        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

        int predictedClass​(de.jungblut.math.DoubleVector features)
        Classifies the given features.
        Returns:
        the predicted class as an integer for the output of a classifier.
      • extractPredictedClass

        int extractPredictedClass​(de.jungblut.math.DoubleVector predict)
        Given an already done prediction, choose the class.
        Returns:
        the class index as integer.
      • extractPredictedClass

        int extractPredictedClass​(de.jungblut.math.DoubleVector predict,
                                  double threshold)
        Given an already done prediction, choose the class with a threshold.
        Returns:
        the class index as integer.
      • asClassifier

        default Classifier asClassifier()
        Backward compatibility method to make online-ml project's predictors work with almost everything in this library.
        Returns:
        an untrainable classifer, wrapping the predictor inside.