mulan.evaluation.measure
Class MacroFMeasure
java.lang.Object
mulan.evaluation.measure.MeasureBase
mulan.evaluation.measure.BipartitionMeasureBase
mulan.evaluation.measure.LabelBasedBipartitionMeasureBase
mulan.evaluation.measure.LabelBasedFMeasure
mulan.evaluation.measure.MacroFMeasure
- All Implemented Interfaces:
- Serializable, MacroAverageMeasure, Measure
public class MacroFMeasure
- extends LabelBasedFMeasure
- implements MacroAverageMeasure
Implementation of the macro-averaged f measure.
- Version:
- 2012.05.29
- Author:
- Grigorios Tsoumakas
- See Also:
- Serialized Form
Constructor Summary |
MacroFMeasure(int numOfLabels)
Constructs a new object with given number of labels and beta=1 |
MacroFMeasure(int numOfLabels,
double beta)
Full constructor |
Method Summary |
String |
getName()
Gets the name of a measure. |
double |
getValue()
Gets the value of a measure. |
double |
getValue(int labelIndex)
Returns the F-Measure for a label |
MacroFMeasure
public MacroFMeasure(int numOfLabels)
- Constructs a new object with given number of labels and beta=1
- Parameters:
numOfLabels
- the number of labels
MacroFMeasure
public MacroFMeasure(int numOfLabels,
double beta)
- Full constructor
- Parameters:
numOfLabels
- the number of labelsbeta
- controls the combination of precision and recall
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.
getValue
public double getValue()
- Description copied from interface:
Measure
- Gets the value of a measure. The measure is incrementally cumulated for learner's
prediction by each
Measure.update(MultiLabelOutput, boolean[])
call. The value
returned by the method, returns sum of all update calls divided by the number
of calls (average of all measures for all predictions).
- Specified by:
getValue
in interface Measure
- Returns:
- the average measure value computed so far
getValue
public double getValue(int labelIndex)
- Returns the F-Measure for a label
- Specified by:
getValue
in interface MacroAverageMeasure
- Parameters:
labelIndex
- the index of a label (starting from 0)
- Returns:
- the F-Measure for the given label