mulan.evaluation.measure
Class MeasureBase
java.lang.Object
mulan.evaluation.measure.MeasureBase
- All Implemented Interfaces:
- Serializable, Measure
- Direct Known Subclasses:
- BipartitionMeasureBase, ConfidenceMeasureBase, RankingMeasureBase
public abstract class MeasureBase
- extends Object
- implements Measure, Serializable
- Author:
- Grigorios Tsoumakas
- See Also:
- Serialized Form
Method Summary |
Measure |
makeCopy()
Creates a deep copy of the given measure using serialization. |
String |
toString()
Returns a string with the value of a measure |
void |
update(MultiLabelOutput prediction,
boolean[] truth)
Computes the value of a measure for the given prediction and true labels. |
protected abstract void |
updateInternal(MultiLabelOutput prediction,
boolean[] truth)
Updates the measure based on an example |
MeasureBase
public MeasureBase()
update
public final void update(MultiLabelOutput prediction,
boolean[] truth)
- Description copied from interface:
Measure
- Computes the value of a measure for the given prediction and true labels. The immediate value of
a measure is returned and result is added to the cumulated measure value.
- Specified by:
update
in interface Measure
- Parameters:
prediction
- the prediction for which measure has to be computedtruth
- the true labels bipartition for given prediction- See Also:
Measure.getValue()
toString
public String toString()
- Returns a string with the value of a measure
- Overrides:
toString
in class Object
- Returns:
- string representation of the value of a measure
updateInternal
protected abstract void updateInternal(MultiLabelOutput prediction,
boolean[] truth)
- Updates the measure based on an example
- Parameters:
prediction
- the output of the algorithm for the exampletruth
- the ground truth of the example
makeCopy
public Measure makeCopy()
throws Exception
- Description copied from interface:
Measure
- Creates a deep copy of the given measure using serialization.
- Specified by:
makeCopy
in interface Measure
- Returns:
- a deep copy of the measure
- Throws:
Exception
- if an error occurs while making copy of the measure.