Package de.jungblut.classification
Class AbstractPredictor
- java.lang.Object
-
- de.jungblut.classification.AbstractPredictor
-
- All Implemented Interfaces:
Predictor
- Direct Known Subclasses:
AbstractClassifier
public abstract class AbstractPredictor extends java.lang.Object implements Predictor
-
-
Constructor Summary
Constructors Constructor Description AbstractPredictor()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description intextractPredictedClass(de.jungblut.math.DoubleVector predict)Given an already done prediction, choose the class.intextractPredictedClass(de.jungblut.math.DoubleVector predict, double threshold)Given an already done prediction, choose the class with a threshold.intpredictedClass(de.jungblut.math.DoubleVector features)Classifies the given features.intpredictedClass(de.jungblut.math.DoubleVector features, double threshold)Classifies the given features.de.jungblut.math.DoubleVectorpredictProbability(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
-
Methods inherited from interface de.jungblut.classification.Predictor
asClassifier, predict
-
-
-
-
Method Detail
-
predictedClass
public int predictedClass(de.jungblut.math.DoubleVector features, double threshold)Description copied from interface:PredictorClassifies the given features.- Specified by:
predictedClassin interfacePredictorthreshold- 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:PredictorClassifies the given features.- Specified by:
predictedClassin interfacePredictor- 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:PredictorClassifies the given features.- Specified by:
predictProbabilityin interfacePredictor- 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:PredictorGiven an already done prediction, choose the class.- Specified by:
extractPredictedClassin interfacePredictor- Returns:
- the class index as integer.
-
extractPredictedClass
public int extractPredictedClass(de.jungblut.math.DoubleVector predict, double threshold)Description copied from interface:PredictorGiven an already done prediction, choose the class with a threshold.- Specified by:
extractPredictedClassin interfacePredictor- Returns:
- the class index as integer.
-
-