|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.apache.mahout.classifier.evaluation.Auc
public class Auc
Computes AUC and a few other accuracy statistics without storing huge amounts of data. This is done by keeping uniform samples of the positive and negative scores. Then, when AUC is to be computed, the remaining scores are sorted and a rank-sum statistic is used to compute the AUC. Since AUC is invariant with respect to down-sampling of either positives or negatives, this is close to correct and is exactly correct if maxBufferSize or fewer positive and negative scores are examined.
Constructor Summary | |
---|---|
Auc()
|
|
Auc(double threshold)
Allocates a new data-structure for accumulating information about AUC and a few other accuracy measures. |
Method Summary | |
---|---|
void |
add(int trueValue,
double score)
Adds a score to the AUC buffers. |
void |
add(int trueValue,
int predictedClass)
|
double |
auc()
Computes the AUC of points seen so far. |
Matrix |
confusion()
Returns the confusion matrix for the classifier supposing that we were to use a particular threshold. |
Matrix |
entropy()
Returns a matrix related to the confusion matrix and to the log-likelihood. |
boolean |
isProbabilityScore()
|
void |
setMaxBufferSize(int maxBufferSize)
|
void |
setProbabilityScore(boolean probabilityScore)
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public Auc(double threshold)
threshold
- The threshold to use in computing the confusion matrix.public Auc()
Method Detail |
---|
public void add(int trueValue, double score)
trueValue
- Whether this score is for a true-positive or a true-negative example.score
- The score for this example.public void add(int trueValue, int predictedClass)
public double auc()
public Matrix confusion()
public Matrix entropy()
public void setMaxBufferSize(int maxBufferSize)
public boolean isProbabilityScore()
public void setProbabilityScore(boolean probabilityScore)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |