se.lth.cs.nlp.nlputils.annotations
Class CompareResult

java.lang.Object
  extended by se.lth.cs.nlp.nlputils.annotations.CompareResult

public class CompareResult
extends Object

The result of a comparison of two layers.

Author:
Richard Johansson (richard@cs.lth.se)

Field Summary
 int nCorrect
           
 int nInGold
           
 int nPartialMatches
           
 int nPredicted
           
 
Constructor Summary
CompareResult()
           
 
Method Summary
 void add(CompareResult other)
          Adds another CompareResult to this one.
 double getF(double beta)
          Returns a weighted F-measure.
 double getF1()
          Returns the F-measure with equal weights, that is the harmonic mean of the precision and the recall.
 double getLenientPrecision()
          Returns the precision when partial matches are counted as correct.
 double getPrecision()
          Returns the precision, that is the probability that a guess is correct.
 double getRecall()
          Returns the recall, that is the probability that an item from the gold standard is retrieved.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

nCorrect

public int nCorrect

nPartialMatches

public int nPartialMatches

nPredicted

public int nPredicted

nInGold

public int nInGold
Constructor Detail

CompareResult

public CompareResult()
Method Detail

getPrecision

public double getPrecision()
Returns the precision, that is the probability that a guess is correct.

Returns:
the precision.

getRecall

public double getRecall()
Returns the recall, that is the probability that an item from the gold standard is retrieved.

Returns:
the recall.

getF1

public double getF1()
Returns the F-measure with equal weights, that is the harmonic mean of the precision and the recall.

Returns:
the unweighted F-measure.

getF

public double getF(double beta)
Returns a weighted F-measure. A beta value below 1 pulls the F-measure towards the precision and a value above 1 towards the recall.

Parameters:
beta - the parameter beta
Returns:
the weighted F-measure.

getLenientPrecision

public double getLenientPrecision()
Returns the precision when partial matches are counted as correct.

Returns:
the lenient precision.

toString

public String toString()
Overrides:
toString in class Object

add

public void add(CompareResult other)
Adds another CompareResult to this one.

Parameters:
other - the other CompareResult.