de.fu_berlin.ties.classify
Class Reranker

java.lang.Object
  extended by de.fu_berlin.ties.classify.Reranker

public class Reranker
extends Object

Reranks the predictions in a distribution by multiplying the probabilities of each of them with a bias, if specified for the type of the prediction.

Version:
$Revision: 1.11 $, $Date: 2006/10/21 16:03:55 $, $Author: siefkes $
Author:
Christian Siefkes

Constructor Summary
Reranker()
          Creates a new "dummy" instance instance that always returns the original prediction distribution.
Reranker(Configuration config)
          Creates a new instance.
Reranker(Map<String,Double> biases)
          Creates a new instance.
 
Method Summary
 PredictionDistribution rerank(PredictionDistribution origDist)
          Reranks the predictions in a distribution.
 String toString()
          Returns a string representation of this object.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Reranker

public Reranker()
Creates a new "dummy" instance instance that always returns the original prediction distribution.


Reranker

public Reranker(Configuration config)
Creates a new instance.

Parameters:
config - the biases are read from keys starting with "bias" in this configuration (bias.classname = bias, e.g. bias.spam = 0.9)

Reranker

public Reranker(Map<String,Double> biases)
Creates a new instance.

Parameters:
biases - a map from prediction types (Strings) to biases (Doubles); predictions of types not contained in this map are left unchanged
Method Detail

rerank

public PredictionDistribution rerank(PredictionDistribution origDist)
Reranks the predictions in a distribution.

The reranked probability estimates are not renormalized, so the result will not be a real probability distribution because sum of all probabilities will typically be different from 1. If you want to work on a real probability distribution you have to normalize it yourself.

Parameters:
origDist - the prediction distribution to rerank
Returns:
a new prediction distribution containing the reranked predictions; if no biases are defined at all (bias map is empty), the original distribution is returned

toString

public String toString()
Returns a string representation of this object.

Overrides:
toString in class Object
Returns:
a textual representation


Copyright © 2003-2007 Christian Siefkes. All Rights Reserved.