edu.columbia.cs.cg.prdualrank.inference.ranking
Class RankFunction<T>

java.lang.Object
  extended by edu.columbia.cs.cg.prdualrank.inference.ranking.RankFunction<T>
Direct Known Subclasses:
FScoreBasedRankFunction, PrecisionBasedRankFunction, RecallBasedRankFunction

public abstract class RankFunction<T>
extends java.lang.Object

This class is used for our implementation of: "Searching Patterns for Relation Extraction over the Web: Rediscovering the Pattern-Relation Duality" . Y. Fang and K. C.-C. Chang. In WSDM, pages 825-834, 2011. For further information, WSDM 2011 Conference Website .

Description

Abstract class to provide the behavior of different ranking functions that are based on precision and recall.
Classes that extend this one have to overwrite requiresPrecision and/or requiredRecall accordingly to the measure. For instance, FMeasure implements both, because it requires both.
For more information about ranking, see Section 6 of the mentioned paper.

Since:
2011-10-07
Version:
0.1
Author:
Pablo Barrio, Goncalo Simoes
See Also:
WSDM 2011 Conference Website , FMeasure

Constructor Summary
RankFunction()
           
 
Method Summary
 java.util.SortedSet<T> rank()
          Generates the ranking of the stored objects.
 boolean requiresPrecision()
          The ranking function has to inform if precision is required in its ranking function.
 boolean requiresRecall()
          The ranking function has to inform if recall is required in its ranking function.
 void setPrecision(java.util.Map<T,java.lang.Double> precisionMap)
          sets the precision map used to generate the ranking.
 void setRecall(java.util.Map<T,java.lang.Double> recallMap)
          sets the recall map used to generate the ranking.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

RankFunction

public RankFunction()
Method Detail

requiresPrecision

public boolean requiresPrecision()
The ranking function has to inform if precision is required in its ranking function.

Returns:
if the ranking function is based in precision

requiresRecall

public boolean requiresRecall()
The ranking function has to inform if recall is required in its ranking function.

Returns:
if the ranking function is based in recall

setPrecision

public void setPrecision(java.util.Map<T,java.lang.Double> precisionMap)
sets the precision map used to generate the ranking.

Parameters:
precisionMap - the map with all the stored precisions.

setRecall

public void setRecall(java.util.Map<T,java.lang.Double> recallMap)
sets the recall map used to generate the ranking.

Parameters:
recallMap - the map with all the stored recall.

rank

public java.util.SortedSet<T> rank()
Generates the ranking of the stored objects.

Returns:
the objects sorted according to the rank function.