double bad5Recall = 0;
double bad5Precision = 0;
for (int i = 0; i < partitionCount; i++) {
setStatusInfo("validation iteration " + i);
ReputationMetricManager rmm = computePartitionReputations(i);
Correlation localResults = correlateQualityPredictions(filter.getPartitions().get(i), rmm);
resultString += String.format(Locale.US, "Partition %d (%d artifacts): " +
"Pearson r=%+.2f, Spearman r=%+.2f, " +
"Top10Recall=%.2f, Top10Precision=%.2f, " +
"Bad10Recall=%.2f, Bad10Precision=%.2f, " +
"\n",
i, filter.getPartitions().get(i).size(),
localResults.getPearsonCorrelation(), localResults.getSpearmanCorrelation(),
localResults.topPercentRecall(0.1), localResults.topPercentPrecision(0.1),
localResults.badPercentRecall(0.1), localResults.badPercentPrecision(0.1)
);
spearman += localResults.getSpearmanCorrelation() / partitionCount;
pearson += localResults.getPearsonCorrelation() / partitionCount;
top20Recall += localResults.topPercentRecall(0.2) / partitionCount;
top20Precision += localResults.topPercentRecall(0.2) / partitionCount;
bad20Recall += localResults.badPercentRecall(0.2) / partitionCount;
bad20Precision += localResults.badPercentPrecision(0.2) / partitionCount;
top10Recall += localResults.topPercentRecall(0.1) / partitionCount;
top10Precision += localResults.topPercentRecall(0.1) / partitionCount;
bad10Recall += localResults.badPercentRecall(0.1) / partitionCount;
bad10Precision += localResults.badPercentPrecision(0.1) / partitionCount;
top5Recall += localResults.topPercentRecall(0.05) / partitionCount;
top5Precision += localResults.topPercentRecall(0.05) / partitionCount;
bad5Recall += localResults.badPercentRecall(0.05) / partitionCount;
bad5Precision += localResults.badPercentPrecision(0.05) / partitionCount;
// clean up
rmm.shutdown();
}
resultString += String.format(Locale.US, "Average Pearson r=%.2f, average Spearman rho=%.2f\n", pearson, spearman);
resultString += String.format(Locale.US, "20%%: Top Recall %.2f Top Precision %.2f Bad Recall %.2f Bad Precision %.2f\n", top20Recall, top20Precision, bad20Recall, bad20Precision);