common
Class PrecisionRecall

java.lang.Object
  extended by common.PrecisionRecall

public class PrecisionRecall
extends java.lang.Object

An object of class PrecisionRecall represents precision and recall statistics for some experiment.


Constructor Summary
PrecisionRecall(double precision, double recall)
          Creates a new PrecisionRecall object with the given precision and recall.
PrecisionRecall(int numTrue, int numFound, int numTrueFound)
          Creates a new PrecisionRecall object for the given experimental results.
 
Method Summary
 double getF1()
          Returns the F1 statistic, which is the harmonic mean of precision and recall: 1/F1 = 1/P + 1/R.
 double getPrecision()
          Returns the precision, defined as: the number of objects found that have a desired property, divided by the total number of objects found.
 double getRecall()
          Returns the recall, defined as the number of objects found that have a desired property, divided by the total number of objects with that property.
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

PrecisionRecall

public PrecisionRecall(double precision,
                       double recall)
Creates a new PrecisionRecall object with the given precision and recall.


PrecisionRecall

public PrecisionRecall(int numTrue,
                       int numFound,
                       int numTrueFound)
Creates a new PrecisionRecall object for the given experimental results.

Parameters:
numTrue - true number of objects with some desired property
numFound - number of objects found in this experiment
numTrueFound - number of objects found that really have the desired property
Method Detail

getPrecision

public double getPrecision()
Returns the precision, defined as: the number of objects found that have a desired property, divided by the total number of objects found.


getRecall

public double getRecall()
Returns the recall, defined as the number of objects found that have a desired property, divided by the total number of objects with that property.


getF1

public double getF1()
Returns the F1 statistic, which is the harmonic mean of precision and recall: 1/F1 = 1/P + 1/R.


toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object