de.fu_berlin.ties.eval
Class EvalStatus

java.lang.Object
  extended byde.fu_berlin.ties.eval.EvalStatus

public final class EvalStatus
extends Object

Type-safe enumeration of possible evaluation states for predictions (unknown, correct, spurious etc.) and answer keys (missing etc.).

Version:
$Revision: 1.2 $, $Date: 2004/02/27 18:29:23 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
static EvalStatus ALTERNATIVE
          Constant for answer keys that could have proposed as predictions but were not.
static EvalStatus CORRECT
          Constant for correct predictions (true positives) resp for answer keys matched by a prediction.
static EvalStatus IGNORED
          Constant for predictions that were ignored.
static String KEY_EVAL_STATUS
          Serialization key recommended for instances of this class.
static EvalStatus MISSING
          Constant for missing answer keys (false negatives).
static EvalStatus SPURIOUS
          Constant for spurious predictions (false positives).
static EvalStatus TRUTH
          Constant for items defined to be true (answer keys, "gold standard").
static EvalStatus UNKNOWN
          Constant for predictions whose evaluation status is unknown (not yet evaluated).
 
Method Summary
 String getName()
          Returns the name of this instance.
 boolean isAnswerState()
          Whether this state is suitable for an answer key.
 boolean isPredictionState()
          Whether this state is suitable for a prediction.
static EvalStatus parse(String representation)
          Parses a textual representation into an eval status, without using a default object.
static EvalStatus parse(String representation, boolean useDefault)
          Parses a textual representation into an eval status.
 String toString()
          Returns a string representation, printing the name of this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_EVAL_STATUS

public static final String KEY_EVAL_STATUS
Serialization key recommended for instances of this class.

See Also:
Constant Field Values

UNKNOWN

public static final EvalStatus UNKNOWN
Constant for predictions whose evaluation status is unknown (not yet evaluated).


TRUTH

public static final EvalStatus TRUTH
Constant for items defined to be true (answer keys, "gold standard").


CORRECT

public static final EvalStatus CORRECT
Constant for correct predictions (true positives) resp for answer keys matched by a prediction. This is the only instance that is suitable for both answer keys and predictions.


MISSING

public static final EvalStatus MISSING
Constant for missing answer keys (false negatives).


SPURIOUS

public static final EvalStatus SPURIOUS
Constant for spurious predictions (false positives).


ALTERNATIVE

public static final EvalStatus ALTERNATIVE
Constant for answer keys that could have proposed as predictions but were not. When there is only a single instance of each type to predict ("best match" mode), one of the answer keys should be tagged as CORRECT resp. MISSING; the others should be tagged as ALTERNATIVEs.


IGNORED

public static final EvalStatus IGNORED
Constant for predictions that were ignored. When there is only a single instance of each type to predict ("best match" mode), the most probably prediction will be evaluated, while the others of the same type will be ignored.

Method Detail

parse

public static EvalStatus parse(String representation)
                        throws IllegalArgumentException
Parses a textual representation into an eval status, without using a default object. This method can convert to results of getName() and toString() back into the corresponding instance.

Parameters:
representation - the textual representation to parse
Returns:
the eval status object corresponding to the given string
Throws:
IllegalArgumentException - if a given string does not represent a known evaluation status

parse

public static EvalStatus parse(String representation,
                               boolean useDefault)
                        throws IllegalArgumentException
Parses a textual representation into an eval status. This method can convert to results of getName() and toString() back into the corresponding instance.

Parameters:
representation - the textual representation to parse
useDefault - if true, UNKNOWN is returned if the representation is an unparsable (invalid) or null; otherwise an exception is thrown in this case
Returns:
the eval status object corresponding to the given string
Throws:
IllegalArgumentException - if a given string does not represent a known evaluation status and useDefault is false

getName

public String getName()
Returns the name of this instance.

Returns:
the value of the attribute

toString

public String toString()
Returns a string representation, printing the name of this instance.

Returns:
a textual representation

isAnswerState

public boolean isAnswerState()
Whether this state is suitable for an answer key.

Returns:
true iff this state is suitable for an answer key

isPredictionState

public boolean isPredictionState()
Whether this state is suitable for a prediction.

Returns:
true iff this state is suitable for a prediction


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