public class Evaluation extends Object
Constructor and Description |
---|
Evaluation() |
Modifier and Type | Method and Description |
---|---|
double |
accuracy()
Accuracy:
TP + TN / (P + N)
|
void |
addToConfusion(int real,
int guess)
Adds to the confusion matrix
|
int |
classCount(int i)
Returns the number of times the given label
has actually occurred
|
void |
eval(org.nd4j.linalg.api.ndarray.INDArray realOutcomes,
org.nd4j.linalg.api.ndarray.INDArray guesses)
Collects statistics on the real outcomes vs the
guesses.
|
double |
f1()
TP: true positive
FP: False Positive
FN: False Negative
F1 score: 2 * TP / (2TP + FP + FN)
|
double |
f1(int i)
Calculate f1 score for a given class
|
double |
falsePositive()
False positive: wrong guess
|
void |
incrementFalseNegatives(int i) |
void |
incrementFalsePositives(int i) |
void |
incrementTruePositives(int i) |
double |
negative()
Total negatives true negatives + falseNegatives
|
int |
numtimesPredicted(int label)
Returns the number of times a given label was predicted
|
int |
numTimesPredicted(int actual,
int predicted)
Gets the number of times the
given class was predicted for the
given predicted label
|
double |
positive()
Returns all of the positive guesses:
true positive + false negative
|
double |
precision()
Total precision based on guesses so far
|
double |
precision(int i)
Returns the precision for a given label
|
double |
recall()
Returns the recall for the outcomes
|
double |
recall(int i) |
String |
stats() |
double |
trueNegatives()
True negatives: correctly rejected
|
public void eval(org.nd4j.linalg.api.ndarray.INDArray realOutcomes, org.nd4j.linalg.api.ndarray.INDArray guesses)
realOutcomes
- the real outcomes (usually binary)guesses
- the guesses (usually a probability vector)public String stats()
public void addToConfusion(int real, int guess)
real
- the actual guessguess
- the system guesspublic int classCount(int i)
i
- the labelpublic int numtimesPredicted(int label)
label
- the label to getFromOriginpublic int numTimesPredicted(int actual, int predicted)
actual
- actual outcomepredicted
- predicted outcomepublic double precision()
public double trueNegatives()
public double falsePositive()
public double negative()
public double positive()
public double accuracy()
public double f1()
public double f1(int i)
i
- the label to calculate f1 forpublic double recall()
public double recall(int i)
public double precision(int i)
i
- the labelpublic void incrementTruePositives(int i)
public void incrementFalseNegatives(int i)
public void incrementFalsePositives(int i)
Copyright © 2015. All Rights Reserved.