mulan.evaluation.measure
Class MeanAveragePrecision
java.lang.Object
mulan.evaluation.measure.MeasureBase
mulan.evaluation.measure.ConfidenceMeasureBase
mulan.evaluation.measure.LabelBasedAveragePrecision
mulan.evaluation.measure.MeanAveragePrecision
- All Implemented Interfaces:
- Serializable, MacroAverageMeasure, Measure
- Direct Known Subclasses:
- GeometricMeanAveragePrecision
public class MeanAveragePrecision
- extends LabelBasedAveragePrecision
- implements MacroAverageMeasure
Implementation of MAP (Mean Average Precision)
- Version:
- 2010.12.10
- Author:
- Eleftherios Spyromitros-Xioufis
- See Also:
- Serialized Form
MeanAveragePrecision
public MeanAveragePrecision(int numOfLabels)
- Creates a new instance of this class
- Parameters:
numOfLabels
- the number of labels
getValue
public double getValue()
- Calculates map using multiple calls to
getValue(int)
. If a label has 0 relevant examples, then it is omitted from the average.
- Specified by:
getValue
in interface Measure
- Returns:
- the average measure value computed so far
getValue
public double getValue(int labelIndex)
- Returns the average precision for a label. If there are no relevant examples for a given label,
Double.NaN
is returned.
- Specified by:
getValue
in interface MacroAverageMeasure
- Parameters:
labelIndex
- the index of a label (starting from 0)
- Returns:
- the average precision for the given label
getName
public String getName()
- Description copied from interface:
Measure
- Gets the name of a measure.
- Specified by:
getName
in interface Measure
- Returns:
- the name of a measure.
getIdealValue
public double getIdealValue()
- Description copied from interface:
Measure
- Gets an 'ideal' value of a measure. The 'ideal' means, that the value
represents the best achievable performance of a learner for an prediction of
a multi-label task and associated true labels.
- Specified by:
getIdealValue
in interface Measure
- Returns:
- the ideal value