我对分类准确性的理解始终是“#正确分类的实例除以#instances”。使用 Java-ML 并将 LibSVM 应用于多标签问题,我得到每个 CLASS 的准确度(和其他测量值)。我无法弄清楚它们是如何相关的以及整体准确性是多少。
例如,对于我的 3 类问题,我得到以下结果:
Anger: Accuracy = 0.48148148148148145 | F = 0.35 | Precision = 0.310126582278481 | Error rate = 0.5185185185185185
Neutral: Accuracy = 0.9971509971509972 | F = 0.0 | Precision = NaN | Error rate = 0.002849002849002849
Surprise: Accuracy = 0.47863247863247865 | F = 0.5653206650831354 | Precision = 0.616580310880829 | Error rate = 0.5213675213675214
我的代码如下所示:
Map<Object, PerformanceMeasure> pm = cv.crossValidation(data, 5);
for (Object o : pm.keySet()) {
System.out.println(o + ": Accuracy = " + pm.get(o).getAccuracy()
+ " | F = " + pm.get(o).getFMeasure()
+ " | Precision = " + pm.get(o).getPrecision()
+ " | Error rate = " + pm.get(o).getErrorRate());
}