public class Evaluation extends Object
Constructor and Description |
---|
Evaluation() |
Modifier and Type | Method and Description |
---|---|
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.jblas.DoubleMatrix realOutcomes,
org.jblas.DoubleMatrix guesses)
Collects statistics on the real outcomes vs the
guesses.
|
double |
f1() |
double |
f1(int i)
Calculate f1 score for a given class
|
void |
incrementFalseNegatives() |
void |
incrementFalsePositives(int i) |
void |
incrementTruePositives() |
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 |
precision() |
double |
precision(int i)
Returns the precision for a given label
|
double |
recall()
Returns the recall for the outcomes
|
String |
stats() |
public void eval(org.jblas.DoubleMatrix realOutcomes, org.jblas.DoubleMatrix 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 getpublic int numTimesPredicted(int actual, int predicted)
actual
- predicted
- public double precision()
public double f1()
public double f1(int i)
i
- the label to calculate f1 forpublic double recall()
public double precision(int i)
i
- the labelpublic void incrementTruePositives()
public void incrementFalseNegatives()
public void incrementFalsePositives(int i)
Copyright © 2014. All Rights Reserved.