public final class FMeasure extends Object
FMeasure
is an utility class for evaluators
which measure precision, recall and the resulting f-measure.
Evaluation results are the arithmetic mean of the precision
scores calculated for each reference sample and
the arithmetic mean of the recall scores calculated for
each reference sample.Constructor and Description |
---|
FMeasure() |
Modifier and Type | Method and Description |
---|---|
double |
getFMeasure()
Retrieves the f-measure score.
|
double |
getPrecisionScore()
Retrieves the arithmetic mean of the precision scores calculated for each
evaluated sample.
|
double |
getRecallScore()
Retrieves the arithmetic mean of the recall score calculated for each
evaluated sample.
|
void |
mergeInto(FMeasure measure)
Merge results into fmeasure metric.
|
static double |
precision(Object[] references,
Object[] predictions)
Calculates the precision score for the given reference and predicted spans.
|
static double |
recall(Object[] references,
Object[] predictions)
Calculates the recall score for the given reference and predicted spans.
|
String |
toString()
Creates a human read-able
String representation. |
void |
updateScores(Object[] references,
Object[] predictions)
Updates the score based on the number of true positives and
the number of predictions and references.
|
public double getPrecisionScore()
public double getRecallScore()
public double getFMeasure()
public void updateScores(Object[] references, Object[] predictions)
references
- the provided referencespredictions
- the predicted spanspublic void mergeInto(FMeasure measure)
measure
- the fmeasurepublic static double precision(Object[] references, Object[] predictions)
references
- the gold standard spanspredictions
- the predicted spansCopyright © 2020 The Apache Software Foundation. All rights reserved.