|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectedu.stanford.nlp.classify.PRCurve
public class PRCurve
Constructor Summary | |
---|---|
PRCurve(ArrayList<Pair<Double,Integer>> dataScores)
|
|
PRCurve(String filename)
reads scores with classes from a file, sorts by score and creates the arrays |
|
PRCurve(String filename,
boolean svm)
reads scores with classes from a file, sorts by score and creates the arrays |
Method Summary | |
---|---|
double |
accuracy()
|
static boolean |
correct(double score,
int cls)
|
double |
cwa()
confidence weighted accuracy assuming the scores are probabilities and using .5 as treshold |
int[] |
cwaArray()
confidence weighted accuracy assuming the scores are probabilities and using .5 as treshold |
static double |
f1(int tp,
int fp,
int fn)
|
double |
fmeasure(int recall)
what is the f-measure at this recall if we look at the score as the probability of class 1 given x as if coming from logistic regression same as logPrecision but calculating f-measure |
double |
fmeasure(int numleft,
int numright)
the f-measure if we just guess as negativ the first numleft and guess as poitive the last numright |
void |
init(ArrayList<Pair<Double,Integer>> dataScores)
|
void |
initMC(ArrayList<Triple<Double,Integer,Integer>> dataScores)
|
double |
logLikelihood()
assuming the scores are probability of 1 given x |
int |
logPrecision(int recall)
what is the precision at this recall if we look at the score as the probability of class 1 given x as if coming from logistic regression |
static void |
main(String[] args)
|
double |
opFmeasure()
|
double |
optFmeasure(int recall)
what is the optimal f-measure we can achieve given recall guesses using the optimal monotonic function |
double |
optimalAccuracy()
|
double |
optimalCwa()
optimal confidence weighted accuracy assuming for each recall we can fit an optimal monotonic function |
int[] |
optimalCwaArray()
confidence weighted accuracy assuming the scores are probabilities and using .5 as treshold |
int |
precision(int recall)
what is the best precision at the given recall |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
---|
public PRCurve(String filename)
filename
- public PRCurve(String filename, boolean svm)
filename
- public PRCurve(ArrayList<Pair<Double,Integer>> dataScores)
Method Detail |
---|
public double optimalAccuracy()
public double accuracy()
public void init(ArrayList<Pair<Double,Integer>> dataScores)
public void initMC(ArrayList<Triple<Double,Integer,Integer>> dataScores)
public int precision(int recall)
recall
-
public static double f1(int tp, int fp, int fn)
public double fmeasure(int numleft, int numright)
numleft
- numright
-
public int logPrecision(int recall)
recall
-
public double optFmeasure(int recall)
recall
-
public double opFmeasure()
public double fmeasure(int recall)
recall
- make this many guesses for which we are most confidentpublic double logLikelihood()
public double cwa()
public int[] cwaArray()
public int[] optimalCwaArray()
public double optimalCwa()
public static boolean correct(double score, int cls)
public static void main(String[] args)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |