jsat.classifiers.evaluation
Interface ClassificationScore
-
- All Superinterfaces:
- java.io.Serializable
- All Known Implementing Classes:
- Accuracy, AUC, BalancedAccuracy, F1Score, FbetaScore, Kappa, LogLoss, MatthewsCorrelationCoefficient, Precision, Recall, SimpleBinaryClassMetric
public interface ClassificationScore extends java.io.SerializableThis interface defines the contract for evaluating or "scoring" the results on a classification problem.
All classification scores must override theequals(java.lang.Object)andhashCode()methods. If a score has parameters, different objects with different parameters must not be equal. However, different objects with the same parameters must be equal even if their internal states are different
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method and Description voidaddResult(CategoricalResults prediction, int trueLabel, double weight)Adds the given result to the scorevoidaddResults(ClassificationScore other)The score contained in this object is augmented with the results already accumulated in theotherobject.ClassificationScoreclone()booleanequals(java.lang.Object obj)java.lang.StringgetName()Returns the name to present for this scoredoublegetScore()Computes the score for the results that have been enrolled viaaddResult(jsat.classifiers.CategoricalResults, int, double)inthashCode()booleanlowerIsBetter()Returnstrueif a lower score is better, orfalseif a higher score is bettervoidprepare(CategoricalData toPredict)Prepares this score to predict on the given input
-
-
-
Method Detail
-
prepare
void prepare(CategoricalData toPredict)
Prepares this score to predict on the given input- Parameters:
toPredict- the class label information that will be evaluated
-
addResult
void addResult(CategoricalResults prediction, int trueLabel, double weight)
Adds the given result to the score- Parameters:
prediction- the prediction for the data pointtrueLabel- the true label for the data pointweight- the weigh to assign to the data point
-
addResults
void addResults(ClassificationScore other)
The score contained in this object is augmented with the results already accumulated in theotherobject. This does not result in an averaging, but alters the current object to have the same score it would have had if all the results were originally inserted into this object.
This method is only required to work ifotherif of the same class asthisobject.- Parameters:
other- the object to add the results from
-
getScore
double getScore()
Computes the score for the results that have been enrolled viaaddResult(jsat.classifiers.CategoricalResults, int, double)- Returns:
- the score for the current results
-
lowerIsBetter
boolean lowerIsBetter()
Returnstrueif a lower score is better, orfalseif a higher score is better- Returns:
trueif a lower score is better
-
equals
boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
hashCode
int hashCode()
- Overrides:
hashCodein classjava.lang.Object
-
clone
ClassificationScore clone()
-
getName
java.lang.String getName()
Returns the name to present for this score- Returns:
- the score name
-
-
DataMelt 3.0 © DataMelt by jWork.ORG