jsat.classifiers.evaluation
Class AUC
- java.lang.Object
-
- jsat.classifiers.evaluation.AUC
-
- All Implemented Interfaces:
- java.io.Serializable, ClassificationScore
public class AUC extends java.lang.Object implements ClassificationScore
Computes the Area Under the ROC Curve as an evaluation of classification scores. The AUC takes O(n log n) time for n predictions and is only valid for binary classification problems.- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor and Description AUC()Creates a new AUC objectAUC(AUC toClone)Copy constructor
-
Method Summary
All Methods Instance Methods Concrete 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.AUCclone()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 viaClassificationScore.addResult(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
-
-
-
Constructor Detail
-
AUC
public AUC()
Creates a new AUC object
-
AUC
public AUC(AUC toClone)
Copy constructor- Parameters:
toClone- the object to copy
-
-
Method Detail
-
addResult
public void addResult(CategoricalResults prediction, int trueLabel, double weight)
Description copied from interface:ClassificationScoreAdds the given result to the score- Specified by:
addResultin interfaceClassificationScore- Parameters:
prediction- the prediction for the data pointtrueLabel- the true label for the data pointweight- the weigh to assign to the data point
-
addResults
public void addResults(ClassificationScore other)
Description copied from interface:ClassificationScoreThe 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.- Specified by:
addResultsin interfaceClassificationScore- Parameters:
other- the object to add the results from
-
prepare
public void prepare(CategoricalData toPredict)
Description copied from interface:ClassificationScorePrepares this score to predict on the given input- Specified by:
preparein interfaceClassificationScore- Parameters:
toPredict- the class label information that will be evaluated
-
getScore
public double getScore()
Description copied from interface:ClassificationScoreComputes the score for the results that have been enrolled viaClassificationScore.addResult(jsat.classifiers.CategoricalResults, int, double)- Specified by:
getScorein interfaceClassificationScore- Returns:
- the score for the current results
-
lowerIsBetter
public boolean lowerIsBetter()
Description copied from interface:ClassificationScoreReturnstrueif a lower score is better, orfalseif a higher score is better- Specified by:
lowerIsBetterin interfaceClassificationScore- Returns:
trueif a lower score is better
-
equals
public boolean equals(java.lang.Object obj)
- Specified by:
equalsin interfaceClassificationScore- Overrides:
equalsin classjava.lang.Object
-
hashCode
public int hashCode()
- Specified by:
hashCodein interfaceClassificationScore- Overrides:
hashCodein classjava.lang.Object
-
clone
public AUC clone()
- Specified by:
clonein interfaceClassificationScore- Overrides:
clonein classjava.lang.Object
-
getName
public java.lang.String getName()
Description copied from interface:ClassificationScoreReturns the name to present for this score- Specified by:
getNamein interfaceClassificationScore- Returns:
- the score name
-
-
DataMelt 3.0 © DataMelt by jWork.ORG