edu.illinois.cs.cogcomp.lbj.coref.util.stats
Class Correctness

java.lang.Object
  extended by edu.illinois.cs.cogcomp.lbj.coref.util.stats.Correctness

public class Correctness
extends java.lang.Object


Constructor Summary
Correctness()
           
 
Method Summary
static double calcF1(LBJ2.classify.Classifier tested, LBJ2.classify.Classifier correct, java.util.List<? extends java.lang.Object> examples)
          Since labels are always positive for their class (even in the two class (e.g.
static double calcF1(double p, double r)
           
static double calcF1(int truePosPredicts, int truePos, int posPredicts)
           
static double calcF1(java.util.List<java.lang.String> gold, java.util.List<java.lang.String> predicted)
           
static double calcF1Multi(LBJ2.classify.Classifier tested, LBJ2.classify.Classifier correct, java.util.List<? extends java.lang.Object> examples)
           
static double calcF1Multi(java.util.Map<java.lang.String,java.lang.Integer> truePosPredicts, java.util.Map<java.lang.String,java.lang.Integer> truePos, java.util.Map<java.lang.String,java.lang.Integer> posPredicts)
          Currently calculates based on the harmonic mean of the individual labels.
static double calcMultiNoneF1(LBJ2.classify.Classifier predictor, LBJ2.classify.Classifier oracle, java.util.List<? extends java.lang.Object> examples)
          Calculates the F1 for Classifiers that return a multi-class label, all of which labels are considered positive except the "NONE", "negative", and "false" labels.
static double calcPrecision(int truePosPredicts, int posPredicts)
           
static double calcRecall(int truePosPredicts, int truePos)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

Correctness

public Correctness()
Method Detail

calcMultiNoneF1

public static double calcMultiNoneF1(LBJ2.classify.Classifier predictor,
                                     LBJ2.classify.Classifier oracle,
                                     java.util.List<? extends java.lang.Object> examples)
Calculates the F1 for Classifiers that return a multi-class label, all of which labels are considered positive except the "NONE", "negative", and "false" labels.

Parameters:
predictor - The predicting classifier.
oracle - The true classifier.
examples - The examples over which to evaulate the predictor.
Returns:
The F-Score.

calcF1Multi

public static double calcF1Multi(LBJ2.classify.Classifier tested,
                                 LBJ2.classify.Classifier correct,
                                 java.util.List<? extends java.lang.Object> examples)
Parameters:
tested - The Classifier producing labels to be tested.
correct - The classifier producing known correct labels.
examples - A list of examples to test.
Returns:
A combined F (Beta=1) Score.

calcF1Multi

public static double calcF1Multi(java.util.Map<java.lang.String,java.lang.Integer> truePosPredicts,
                                 java.util.Map<java.lang.String,java.lang.Integer> truePos,
                                 java.util.Map<java.lang.String,java.lang.Integer> posPredicts)
Currently calculates based on the harmonic mean of the individual labels.


calcF1

public static double calcF1(LBJ2.classify.Classifier tested,
                            LBJ2.classify.Classifier correct,
                            java.util.List<? extends java.lang.Object> examples)
Since labels are always positive for their class (even in the two class (e.g. binary) case, we assume that positive labels start with T, t, P, or p and negative start with anything else (e.g. F, f, N, or n)

Parameters:
tested - Classifier to be tested
correct - Classifier producing correct labels
examples - List of examples to classify
Returns:
F measure with Beta=1.

calcF1

public static double calcF1(java.util.List<java.lang.String> gold,
                            java.util.List<java.lang.String> predicted)

calcF1

public static double calcF1(int truePosPredicts,
                            int truePos,
                            int posPredicts)

calcF1

public static double calcF1(double p,
                            double r)

calcPrecision

public static double calcPrecision(int truePosPredicts,
                                   int posPredicts)

calcRecall

public static double calcRecall(int truePosPredicts,
                                int truePos)