Class UntrainableClassifier

    • 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.
      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.
      void train​(de.jungblut.math.DoubleVector[] features, de.jungblut.math.DoubleVector[] outcome)
      Trains this classifier with the given features and the outcome.
      void train​(java.lang.Iterable<de.jungblut.math.DoubleVector> features, java.lang.Iterable<de.jungblut.math.DoubleVector> outcome)
      Trains this classifier with the given features and the outcome.
      • Methods inherited from class java.lang.Object

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

      • UntrainableClassifier

        public UntrainableClassifier​(Predictor predictor)
    • Method Detail

      • predict

        public de.jungblut.math.DoubleVector predict​(de.jungblut.math.DoubleVector features)
        Description copied from interface: Predictor
        Classifies the given features.
        Specified by:
        predict in interface Predictor
        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

        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.
      • 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.
      • 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.
      • train

        public void train​(java.lang.Iterable<de.jungblut.math.DoubleVector> features,
                          java.lang.Iterable<de.jungblut.math.DoubleVector> outcome)
        Description copied from interface: Classifier
        Trains this classifier with the given features and the outcome. This is the streaming method for training, it takes parallel iterables.
        Specified by:
        train in interface Classifier
        outcome - the outcome must have classes labeled as doubles. E.G. in the binary case you have a single element and decide between 0d and 1d. In higher dimensional cases you have each of these single elements mapped to a dimension.
      • train

        public void train​(de.jungblut.math.DoubleVector[] features,
                          de.jungblut.math.DoubleVector[] outcome)
        Description copied from interface: Classifier
        Trains this classifier with the given features and the outcome.
        Specified by:
        train in interface Classifier
        outcome - the outcome must have classes labeled as doubles. E.G. in the binary case you have a single element and decide between 0d and 1d. In higher dimensional cases you have each of these single elements mapped to a dimension.