public final class FMeasure
extends java.lang.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(java.lang.Object[] references,
java.lang.Object[] predictions)
Calculates the precision score for the given reference and predicted spans.
|
static double |
recall(java.lang.Object[] references,
java.lang.Object[] predictions)
Calculates the recall score for the given reference and predicted spans.
|
java.lang.String |
toString()
Creates a human read-able
String representation. |
void |
updateScores(java.lang.Object[] references,
java.lang.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(java.lang.Object[] references, java.lang.Object[] predictions)
references
- the provided referencespredictions
- the predicted spanspublic void mergeInto(FMeasure measure)
measure
- the fmeasurepublic java.lang.String toString()
String
representation.toString
in class java.lang.Object
public static double precision(java.lang.Object[] references, java.lang.Object[] predictions)
references
- the gold standard spanspredictions
- the predicted spanspublic static double recall(java.lang.Object[] references, java.lang.Object[] predictions)
references
- the gold standard spanspredictions
- the predicted spansCopyright © 2010 - 2020 Adobe. All Rights Reserved