Closed scarlettllc closed 3 years ago
Problem fixed.
public double getAverageF1() {
if (numSample == 0)
return 0.0;
return cumulativeMicroF1 / numSample;
}
public double getMacroF1() {
if (getPrecision() + getRecall() == 0.0)
return 0.0;
return 2.0 * (getPrecision() * getRecall()) / (getPrecision() + getRecall());
}
public String toString() {
return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", macro F1: " + decimalFormat.format(getMacroF1());
}
public String toQALDString() {
return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", average F1: " + decimalFormat.format(getAverageF1()) + ", QALD macro F1: " + decimalFormat.format(getMacroF1());
}
}
More information are detailed in the QALD paper.
I feel confused about the correspondence between macro F1 and getMicroF1() in both function toString and toQALDString in file CumulativeIRMetrics.java. Maybe there is a small mistake?
public String toString() { return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", macro F1: " + decimalFormat.format(getMicroF1()) + ", macro F1*: " + decimalFormat.format(getMacroF1()); }
public String toQALDString() { return "sample: " + numSample + ", P: " + decimalFormat.format(getPrecision()) + ", R: " + decimalFormat.format(getRecall()) + ", macro F1: " + decimalFormat.format(getMicroF1()) + ", QALD macro F1: " + decimalFormat.format(getMacroF1()); } }