de.fu_berlin.ties.eval
Class SummaryFMetrics

java.lang.Object
  extended byde.fu_berlin.ties.io.BaseStorable
      extended byde.fu_berlin.ties.eval.FMetrics
          extended byde.fu_berlin.ties.eval.SummaryFMetrics
All Implemented Interfaces:
EvalInput, FMetricsSummary, FMetricsView, Storable

public class SummaryFMetrics
extends FMetrics
implements FMetricsSummary

FMetrics extension that additionally calculates a StatisticalSummary of the intermediate precision, recall, and F1 metrics resulting from different update operations. Values added by inc... operations are not considered for summaries.

Especially the standard deviations might be interested -- thus they are serialized in addition to the values stored by the superclass. The summaries cannot be restored during deserialization because not all required information is serialized.

Version:
$Revision: 1.3 $, $Date: 2004/02/20 17:49:18 $, $Author: siefkes $
Author:
Christian Siefkes

Field Summary
static String PREFIX_STD_DEVIATION
          Prefix of serialization keys for standard deviations.
 
Fields inherited from class de.fu_berlin.ties.eval.FMetrics
KEY_F1_MEASURE, KEY_FALSE_NEG, KEY_FALSE_POS, KEY_PRECISION, KEY_RECALL, KEY_TRUE_POS
 
Constructor Summary
SummaryFMetrics()
          Creates a new empty instance.
SummaryFMetrics(FieldMap fieldMap)
          Creates a new instance from a field map, fulfilling the Storable contract.
 
Method Summary
 FieldMap storeFields()
          Stores all relevant fields of this object in a field map for serialization.
 void update(long addTruePos, long addFalseNeg, long addFalsePos)
          Updates the statistics, increasing the stored values as specified and updating the statistical summaries.
 StatisticalSummary viewF1Summary()
          Returns a summary view on the F1 values.
 StatisticalSummary viewPrecisionSummary()
          Returns a summary view on the precision values.
 StatisticalSummary viewRecallSummary()
          Returns a summary view on the recall values.
 
Methods inherited from class de.fu_berlin.ties.eval.FMetrics
getF1Measure, getFalseNeg, getFalsePos, getFMeasure, getPrecision, getRecall, getTruePos, incFalseNeg, incFalsePos, incTruePos, update
 
Methods inherited from class de.fu_berlin.ties.io.BaseStorable
toString, toString
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

PREFIX_STD_DEVIATION

public static final String PREFIX_STD_DEVIATION
Prefix of serialization keys for standard deviations.

See Also:
Constant Field Values
Constructor Detail

SummaryFMetrics

public SummaryFMetrics()
Creates a new empty instance.


SummaryFMetrics

public SummaryFMetrics(FieldMap fieldMap)
                throws IllegalArgumentException
Creates a new instance from a field map, fulfilling the Storable contract. Any summary information stored in the initial instance will be lost, thus summaries calculated after restoring will be inaccurate.

Parameters:
fieldMap - map containing the serialized fields
Throws:
IllegalArgumentException - if at least one of the parameters is negative or missing
Method Detail

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. The calculated values precision, recall, and F-measure and their standard deviations are also stored (they are ignored when deserializing a stored instance).

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

update

public final void update(long addTruePos,
                         long addFalseNeg,
                         long addFalsePos)
                  throws IllegalArgumentException
Updates the statistics, increasing the stored values as specified and updating the statistical summaries.

Overrides:
update in class FMetrics
Parameters:
addTruePos - the number of new true positives to add
addFalseNeg - the number of new false negatives to add
addFalsePos - the number of new false positives to add
Throws:
IllegalArgumentException - if at least one of the parameters is negative

viewF1Summary

public StatisticalSummary viewF1Summary()
Returns a summary view on the F1 values. This is not a snapshot but will change whenever the underlying values are changed.

Specified by:
viewF1Summary in interface FMetricsSummary
Returns:
a summary view on the F1 value

viewPrecisionSummary

public StatisticalSummary viewPrecisionSummary()
Returns a summary view on the precision values. This is not a snapshot but will change whenever the underlying values are changed.

Specified by:
viewPrecisionSummary in interface FMetricsSummary
Returns:
a summary view on the precision value

viewRecallSummary

public StatisticalSummary viewRecallSummary()
Returns a summary view on the recall values. This is not a snapshot but will change whenever the underlying values are changed.

Specified by:
viewRecallSummary in interface FMetricsSummary
Returns:
a summary view on the recall value


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