CLASS
- type of class predicted by the Classifier
public class BasicClassificationResult<CLASS> extends Object implements ClassificationResult<CLASS>
ClassificationResult
that internally
maintains a map of classes to confidences.
A threshold is used to determine whether a class has a high-enough confidence to be considered part of the predicted set of classes.
Constructor and Description |
---|
BasicClassificationResult()
Construct with a default threshold of 0.
|
BasicClassificationResult(double threshold)
Construct with the given threshold.
|
Modifier and Type | Method and Description |
---|---|
double |
getConfidence(CLASS clazz)
Get the confidence associated with the given class.
|
Set<CLASS> |
getPredictedClasses()
Get the set of classes predicted by this result.
|
void |
put(CLASS clz,
double confidence)
Add a class/confidence pair.
|
public BasicClassificationResult()
public BasicClassificationResult(double threshold)
threshold
- the thresholdpublic void put(CLASS clz, double confidence)
clz
- the classconfidence
- the confidencepublic double getConfidence(CLASS clazz)
ClassificationResult
Normally, confidence values are bounded between 0 and 1.
getConfidence
in interface ClassificationResult<CLASS>
clazz
- the target class.public Set<CLASS> getPredictedClasses()
ClassificationResult
getPredictedClasses
in interface ClassificationResult<CLASS>