diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java index faa94a26801..7cc5a8dd5f4 100644 --- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java +++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java @@ -77,7 +77,7 @@ public class KNearestNeighborClassifier implements Classifier { assignedClass = cl; } } - double score = classCounts.get(assignedClass) / k; + double score = max / k; return new ClassificationResult(assignedClass, score); }