iglu.ir
Class PRResult

java.lang.Object
  |
  +--iglu.ir.PRResult
All Implemented Interfaces:
java.io.Serializable

public class PRResult
extends java.lang.Object
implements java.io.Serializable

The results of a PrecisionRecall experiment on a particular query. This class is loaded with the results of a precesion/recall test on a single query, and is able to interpolate to give back arbitrary results. So you tell it which queries you actually made, and the results, and it will tell you the values for recall=0.1, 0.2, etc. This is used by the PrecisionRecall class to give its results.

Author:
Travis Bauer
See Also:
PrecisionRecall, Serialized Form

Field Summary
 java.util.TreeMap docOrder
           
 int numDocs
           
 int numInterp
           
 int numRelevant
           
(package private) static double[] precList
          The default number of documents to display
 java.util.TreeMap precOrder
           
(package private)  double precTotal
           
(package private)  java.io.Serializable qid
           
 double querySize
           
 double queryTime
           
 java.util.TreeMap recallOrder
           
(package private)  double recTotal
           
 
Constructor Summary
PRResult(int numRelevant, int numDocs, java.io.Serializable qid)
          Create a new PRResult object.
 
Method Summary
 void addMetaData(double size, double time)
          Add information about the size of the query and the time the query took
 void addTest(PRPair prpair)
          Add the results of a particular precision/recall test to this PRResult.
static void main(java.lang.String[] argv)
          A simple test of the PRResult class
 double precAtNumDocs(double numDocs)
          Returns the precision at a particular number of documents.
 double precAtRecall(double recall)
          Give the number of docs retrieved and the precision for the given recall.
 java.lang.String realResults()
          Return a String containing all the values really stored in the PRResut.
static double[] rpAverages(java.util.Collection results)
          Calculate and return the average precision across all queries for the values (0.0, 0.1, 0.2, .
static double[] rpAverages(PRResult[] rsts)
          Calculate and return the average precision across all queries for the values (0.0, 0.1, 0.2, .
 javax.swing.JPanel toPane()
          return a pane containing two graphs: The recall/precision graph and the documents/precision graph.
 java.lang.String toString()
          Return a string interpretation of this PRResult.
static javax.swing.JTabbedPane toTabbedPane(PRResult[] rs)
          A convienence class to construct a tabbed pane of the results.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

numRelevant

public int numRelevant

numDocs

public int numDocs

numInterp

public int numInterp

qid

java.io.Serializable qid

precTotal

double precTotal

recTotal

double recTotal

querySize

public double querySize

queryTime

public double queryTime

docOrder

public java.util.TreeMap docOrder

precOrder

public java.util.TreeMap precOrder

recallOrder

public java.util.TreeMap recallOrder

precList

static final double[] precList
The default number of documents to display

Constructor Detail

PRResult

public PRResult(int numRelevant,
                int numDocs,
                java.io.Serializable qid)
Create a new PRResult object.

Parameters:
numRelevant - The number of relevant documents for this query.
numDocs - The total number of documents for this query.
qid - A name for this query.
Method Detail

addMetaData

public void addMetaData(double size,
                        double time)
Add information about the size of the query and the time the query took


addTest

public void addTest(PRPair prpair)
Add the results of a particular precision/recall test to this PRResult.


precAtNumDocs

public double precAtNumDocs(double numDocs)
Returns the precision at a particular number of documents. It will interpolate if exact results are not available.


precAtRecall

public double precAtRecall(double recall)
Give the number of docs retrieved and the precision for the given recall. It will give exact results if it has them. Otherwise it will interpolate.


toString

public java.lang.String toString()
Return a string interpretation of this PRResult. The string returned is a multi-line string with two tables: The recall/precision table and the number of docs/precision table. Also shows some other information about the result. Interpolated values are indicated.

Overrides:
toString in class java.lang.Object

toPane

public javax.swing.JPanel toPane()
return a pane containing two graphs: The recall/precision graph and the documents/precision graph.


toTabbedPane

public static javax.swing.JTabbedPane toTabbedPane(PRResult[] rs)
A convienence class to construct a tabbed pane of the results. The graphs for each result are shown on a different tab.


rpAverages

public static double[] rpAverages(java.util.Collection results)
Calculate and return the average precision across all queries for the values (0.0, 0.1, 0.2, . . . 1.0);


rpAverages

public static double[] rpAverages(PRResult[] rsts)
Calculate and return the average precision across all queries for the values (0.0, 0.1, 0.2, . . . 1.0);


realResults

public java.lang.String realResults()
Return a String containing all the values really stored in the PRResut. Listed in order of number of documents return.


main

public static void main(java.lang.String[] argv)
A simple test of the PRResult class