Skip to content
Snippets Groups Projects
Commit d352cb3f authored by VERNEREY Charles's avatar VERNEREY Charles
Browse files

Solve bug with ranking metric

parent 1ce46e4b
Branches
No related tags found
No related merge requests found
...@@ -128,7 +128,13 @@ public class LearnFunctionAndRankCli implements Callable<Integer> { ...@@ -128,7 +128,13 @@ public class LearnFunctionAndRankCli implements Callable<Integer> {
private List<RankingMetric> getRankingMetrics(int nbRules) { private List<RankingMetric> getRankingMetrics(int nbRules) {
int top1 = (int) (0.01 * nbRules); int top1 = (int) (0.01 * nbRules);
if (top1 <= 0) {
top1 = 1;
}
int top10 = (int) (0.1 * nbRules); int top10 = (int) (0.1 * nbRules);
if (top10 <= 0) {
top10 = 1;
}
return Arrays.asList(new KendallConcordanceCoeff(), new SpearmanRankCorrelationCoefficient(), return Arrays.asList(new KendallConcordanceCoeff(), new SpearmanRankCorrelationCoefficient(),
new RecallMetric(top1), new RecallMetric(top10), new AveragePrecision(top1), new AveragePrecision(top10)); new RecallMetric(top1), new RecallMetric(top10), new AveragePrecision(top1), new AveragePrecision(top10));
} }
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment