de.fu_berlin.ties.classify
Class PredictionComparator
java.lang.Object
de.fu_berlin.ties.classify.PredictionComparator
- All Implemented Interfaces:
- Comparator
- public class PredictionComparator
- extends Object
- implements Comparator
A comparison function that compares
Prediction
s based on their
pRs and
probabilities.
- Version:
- $Revision: 1.3 $, $Date: 2004/04/02 14:34:42 $, $Author: siefkes $
- Author:
- Christian Siefkes
PredictionComparator
public PredictionComparator()
- Creates a new instance.
compare
public int compare(Object o1,
Object o2)
throws ClassCastException
- Compares two
Prediction
s. This method checks whether the
pR values of both predictions are given
and compares them if they are. Otherwise the
probabilities are compared.
In case of a tie the raw
scores are compared if both are WinnowPrediction
s.
Otherwise the types are compared
lexicographically.
- Specified by:
compare
in interface Comparator
- Parameters:
o1
- the first prediction to be comparedo2
- the second prediction to be compared
- Returns:
- a negative integer, zero, or a positive integer if the first
argument is less than, equal to, or greater than of the second
- Throws:
ClassCastException
- if either of the arguments is not a
Prediction
toString
public String toString()
- Returns a string representation of this object.
- Returns:
- a textual representation
Copyright © 2003-2004 Christian Siefkes. All Rights Reserved.