edu.cmu.minorthird.classify.ranking
Class RankingEvaluation

java.lang.Object
  extended by edu.cmu.minorthird.classify.ranking.RankingEvaluation
All Implemented Interfaces:
Visible, Saveable

public class RankingEvaluation
extends java.lang.Object
implements Visible, Saveable

Evaluate a classifier as a ranker


Nested Class Summary
 class RankingEvaluation.MyCLP
           
 
Constructor Summary
RankingEvaluation()
           
 
Method Summary
 double[] averageElevenPointPrecision()
          Interpolated precision at eleven recall levels, averaged over all examples.
 double averagePrecision(java.lang.String rankingId)
          Non-interpolated average precision.
 java.lang.String averageRecallAsFunctionOfK()
          Recall as function of K, averaged over all examples.
 double[] elevenPointPrecision(java.lang.String rankingId)
          Interpolated precision at eleven recall levels: 0.0, ...
 void extend(java.lang.String rankingId, java.util.List<Example> ranking, BinaryClassifier classifier)
           
 void extend(java.lang.String rankingId, java.util.List<Example> ranking, BinaryClassifier classifier, java.util.Set<java.lang.String> unrankedPos)
           
 java.lang.String getExtensionFor(java.lang.String format)
          Recomended extension for the format with the given name.
 java.lang.String[] getFormatNames()
          List of formats in which the object can be saved.
static RankingEvaluation load(java.io.File file)
           
static void main(java.lang.String[] args)
           
 double maxF1(java.lang.String rankingId)
          Max value of F1 over all possible thresholds.
 double maxRecall(java.lang.String rankingId)
           
 void processArguments(java.lang.String[] args)
           
 java.lang.Object restore(java.io.File file)
          Restore the object from a file.
 void saveAs(java.io.File file, java.lang.String formatName)
          Save this object to the given file, in the given format.
 Viewer toGUI()
          Create a view of this object
 java.lang.String toTable()
          A summary table.
 java.lang.String toTable(java.lang.String name, int numToShowAllEntries)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankingEvaluation

public RankingEvaluation()
Method Detail

extend

public void extend(java.lang.String rankingId,
                   java.util.List<Example> ranking,
                   BinaryClassifier classifier)

extend

public void extend(java.lang.String rankingId,
                   java.util.List<Example> ranking,
                   BinaryClassifier classifier,
                   java.util.Set<java.lang.String> unrankedPos)

averagePrecision

public double averagePrecision(java.lang.String rankingId)
Non-interpolated average precision.


maxF1

public double maxF1(java.lang.String rankingId)
Max value of F1 over all possible thresholds.


maxRecall

public double maxRecall(java.lang.String rankingId)

averageElevenPointPrecision

public double[] averageElevenPointPrecision()
Interpolated precision at eleven recall levels, averaged over all examples.


elevenPointPrecision

public double[] elevenPointPrecision(java.lang.String rankingId)
Interpolated precision at eleven recall levels: 0.0, ... ,1.0


toTable

public java.lang.String toTable()
A summary table. Columns are: avgpr, the non-interpolated average precision of the ranking (the average of this is thus mean average precision); maxF1, the maximum F1 value for the ranking; maxRec, the maximum recall achieved (i.e., the fraction of relevant nodes appearing in the ranking); and #pos, the number of positive/relevant nodes.


averageRecallAsFunctionOfK

public java.lang.String averageRecallAsFunctionOfK()
Recall as function of K, averaged over all examples.


toTable

public java.lang.String toTable(java.lang.String name,
                                int numToShowAllEntries)

toGUI

public Viewer toGUI()
Description copied from interface: Visible
Create a view of this object

Specified by:
toGUI in interface Visible

getFormatNames

public java.lang.String[] getFormatNames()
Description copied from interface: Saveable
List of formats in which the object can be saved.

Specified by:
getFormatNames in interface Saveable

getExtensionFor

public java.lang.String getExtensionFor(java.lang.String format)
Description copied from interface: Saveable
Recomended extension for the format with the given name.

Specified by:
getExtensionFor in interface Saveable

saveAs

public void saveAs(java.io.File file,
                   java.lang.String formatName)
            throws java.io.IOException
Description copied from interface: Saveable
Save this object to the given file, in the given format.

Specified by:
saveAs in interface Saveable
Throws:
java.io.IOException

restore

public java.lang.Object restore(java.io.File file)
                         throws java.io.IOException
Description copied from interface: Saveable
Restore the object from a file.

Specified by:
restore in interface Saveable
Throws:
java.io.IOException

load

public static RankingEvaluation load(java.io.File file)
                              throws java.io.IOException
Throws:
java.io.IOException

processArguments

public void processArguments(java.lang.String[] args)

main

public static void main(java.lang.String[] args)
                 throws java.io.IOException
Throws:
java.io.IOException