de.fu_berlin.ties.classify.winnow
Class WinnowPrediction

java.lang.Object
  extended by de.fu_berlin.ties.io.BaseStorable
      extended by de.fu_berlin.ties.classify.Prediction
          extended by de.fu_berlin.ties.classify.winnow.WinnowPrediction
All Implemented Interfaces:
Storable

public class WinnowPrediction
extends Prediction

A prediction that also stores a raw score (activation value) and a normalized score, as calculated by the Winnow algorithm. The pR is never set by this class.

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

Field Summary
static String KEY_NORMALIZED
          Serialization key for the source identifier.
static String KEY_RAW
          Serialization key for the predicted class.
 
Fields inherited from class de.fu_berlin.ties.classify.Prediction
KEY_PR, KEY_PROB, KEY_SOURCE, KEY_TYPE
 
Constructor Summary
WinnowPrediction(FieldMap fieldMap)
          Creates a new instance from a field map, fulfilling the Storable contract.
WinnowPrediction(String predicted, double prob, float raw, float normalized)
          Creates a new instance, setting the evaluation status to EvalStatus.UNKNOWN.
WinnowPrediction(String predicted, double prob, float raw, float normalized, EvalStatus status)
          Creates a new instance, without setting a source ID.
WinnowPrediction(String predicted, String sourceID, double prob, float raw, float normalized, EvalStatus status)
          Creates a new instance.
 
Method Summary
 float getNormalizedScore()
          Returns the normalized score (activation value) of this prediction.
 float getRawScore()
          Returns the raw score (activation value) of this prediction.
 FieldMap storeFields()
          Stores all relevant fields of this object in a field map for serialization.
 
Methods inherited from class de.fu_berlin.ties.classify.Prediction
addProb, equals, getEvalStatus, getProbability, getSource, getType, hashCode, probCount, removeProb, setEvalStatus, setSource
 
Methods inherited from class de.fu_berlin.ties.io.BaseStorable
toString, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Field Detail

KEY_RAW

public static final String KEY_RAW
Serialization key for the predicted class.

See Also:
Constant Field Values

KEY_NORMALIZED

public static final String KEY_NORMALIZED
Serialization key for the source identifier.

See Also:
Constant Field Values
Constructor Detail

WinnowPrediction

public WinnowPrediction(FieldMap fieldMap)
Creates a new instance from a field map, fulfilling the Storable contract.

Parameters:
fieldMap - map containing the serialized fields

WinnowPrediction

public WinnowPrediction(String predicted,
                        double prob,
                        float raw,
                        float normalized)
Creates a new instance, setting the evaluation status to EvalStatus.UNKNOWN.

Parameters:
predicted - the predicted type
prob - the probability of the prediction (must be in the range from 0.0 to 1.0; or -1 if this is a confirmed prediction or an answer key)
raw - the raw score (activation value) of this prediction
normalized - the normalized score (activation value) of this prediction; must be a non-negative value

WinnowPrediction

public WinnowPrediction(String predicted,
                        double prob,
                        float raw,
                        float normalized,
                        EvalStatus status)
Creates a new instance, without setting a source ID.

Parameters:
predicted - the predicted type
prob - the probability of the prediction (must be in the range from 0.0 to 1.0; or -1 if this is a confirmed prediction or an answer key)
raw - the raw score (activation value) of this prediction
normalized - the normalized score (activation value) of this prediction; must be a non-negative value
status - the evaluation status of this instance

WinnowPrediction

public WinnowPrediction(String predicted,
                        String sourceID,
                        double prob,
                        float raw,
                        float normalized,
                        EvalStatus status)
Creates a new instance.

Parameters:
predicted - the predicted type
sourceID - an identifier of the source of this prediction (e.g., the file name), might be null
prob - the probability of the prediction (must be in the range from 0.0 to 1.0; or -1 if this is a confirmed prediction or an answer key)
raw - the raw score (activation value) of this prediction
normalized - the normalized score (activation value) of this prediction; must be a non-negative value
status - the evaluation status of this instance
Method Detail

getNormalizedScore

public float getNormalizedScore()
Returns the normalized score (activation value) of this prediction.

Returns:
the value of the attribute

getRawScore

public float getRawScore()
Returns the raw score (activation value) of this prediction.

Returns:
the value of the attribute

storeFields

public FieldMap storeFields()
Stores all relevant fields of this object in a field map for serialization. An equivalent object can be created by calling FieldMap.createObject(Class) on the created field map.

Specified by:
storeFields in interface Storable
Overrides:
storeFields in class Prediction
Returns:
the created field map


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