|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectde.fu_berlin.ties.io.BaseStorable
de.fu_berlin.ties.eval.Accuracy
public class Accuracy
Counts true and false items and measures the accuracy: A = true / (true + false).
Instances of this class are not thread-safe.
Field Summary | |
---|---|
static String |
KEY_ACCURACY
Serialization key for the accuracy. |
static String |
KEY_FALSE_COUNT
Serialization key for the number of false items. |
static String |
KEY_TRUE_COUNT
Serialization key for the number of true items. |
Constructor Summary | |
---|---|
Accuracy()
Creates a new empty instance, without using a prefix. |
|
Accuracy(FieldMap fieldMap)
Creates a new instance from a field map, fulfilling the Storable contract. |
|
Accuracy(FieldMap fieldMap,
String prefixString)
Creates a new instance from a field map, using a prefix. |
|
Accuracy(String prefixString)
Creates a new empty instance. |
Method Summary | |
---|---|
double |
getAccuracy()
Calculates and returns the accuracy: A = true / (true + false). |
long |
getFalseCount()
Returns the number of false decisions. |
long |
getTrueCount()
Returns the number of true decisions. |
void |
incFalseCount()
Increases the number of false decisions by one. |
void |
incTrueCount()
Increases the number of true decisions by one. |
FieldMap |
storeFields()
Stores all relevant fields of this object in a field map for serialization. |
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 |
---|
public static final String KEY_ACCURACY
public static final String KEY_FALSE_COUNT
public static final String KEY_TRUE_COUNT
Constructor Detail |
---|
public Accuracy()
public Accuracy(String prefixString)
prefixString
- An optional prefix used for (de)serializing this
instance; should typically end in a space; empty string if not usedpublic Accuracy(FieldMap fieldMap) throws IllegalArgumentException
Storable
contract.
fieldMap
- map containing the serialized fields
IllegalArgumentException
- if at least one of the parameters is
negative or missingpublic Accuracy(FieldMap fieldMap, String prefixString) throws IllegalArgumentException
fieldMap
- map containing the serialized fieldsprefixString
- An optional prefix used for (de)serializing this
instance; should typically end in a space; empty string if not used
IllegalArgumentException
- if at least one of the parameters is
negative or missingMethod Detail |
---|
public double getAccuracy()
getAccuracy
in interface AccuracyView
public long getFalseCount()
getFalseCount
in interface AccuracyView
public long getTrueCount()
getTrueCount
in interface AccuracyView
public void incFalseCount()
public void incTrueCount()
public FieldMap storeFields()
FieldMap.createObject(Class)
on the created
field map.
storeFields
in interface Storable
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |