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) |
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) |
public double getPrecisionScore()
public double getRecallScore()
public double getFMeasure()
public void mergeInto(FMeasure measure)
public static double precision(Object[] references, Object[] predictions)
references
- the gold standard spanspredictions
- the predicted spansCopyright © 2018 The Apache Software Foundation. All rights reserved.