FMeasure { public static double recall(Object references[], Object predictions[]) { if (references.length > 0) { return countTruePositives(references, predictions) / (double) references.length; } else { return Double.NaN; } }  double getPrecisionScore(); double getRecallScore(); double getFMeasure(); void updateScores(Object references[], Object predictions[]); void mergeInto(FMeasure measure); @Override String toString(); static double precision(Object references[], Object predictions[]); static double recall(Object references[], Object predictions[]);  }
@Test public void testRecall() { assertEquals(1.0d, FMeasure.recall(gold, gold), DELTA); assertEquals(0, FMeasure.recall(gold, predictedCompletelyDistinct), DELTA); assertEquals(0, FMeasure.recall(gold, new Object[]{}), DELTA); assertEquals(Double.NaN, FMeasure.recall(new Object[]{}, gold), DELTA); assertEquals(2d / gold.length, FMeasure.recall(gold, predicted), DELTA); }