/** * Returns the precision for a given label * * @param classLabel the label * @param edgeCase What to output in case of 0/0 * @return the precision for the label */ public double precision(Integer classLabel, double edgeCase) { double tpCount = truePositives.getCount(classLabel); double fpCount = falsePositives.getCount(classLabel); return EvaluationUtils.precision((long) tpCount, (long) fpCount, edgeCase); }
fpCount += falsePositives.getCount(i); return EvaluationUtils.precision(tpCount, fpCount, DEFAULT_EDGE_VALUE); } else { throw new UnsupportedOperationException("Unknown averaging approach: " + averaging);
fnCount += falseNegatives.getCount(i); double precision = EvaluationUtils.precision(tpCount, fpCount, DEFAULT_EDGE_VALUE); double recall = EvaluationUtils.recall(tpCount, fnCount, DEFAULT_EDGE_VALUE); return EvaluationUtils.gMeasure(precision, recall);