Apache Lucene open-source search software
LUCENE-6631 - added missing javadoc for kNN classifier
Tommaso Teofili505c32b1e4a0
diff --git a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.javaindex b957dca1531..f822b109fcd 100644--- a/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java+++ b/lucene/classification/src/java/org/apache/lucene/classification/KNearestNeighborClassifier.java@@ -182,6 +182,12 @@ public class KNearestNeighborClassifier implements Classifier<BytesRef> {}//ranking of classes must be taken in consideration+ /**+ * build a list of classification results from search results+ * @param topDocs the search results as a {@link TopDocs} object+ * @return a {@link List} of {@link ClassificationResult}, one for each existing class+ * @throws IOException if it's not possible to get the stored value of class field+ */protected List<ClassificationResult<BytesRef>> buildListFromTopDocs(TopDocs topDocs) throws IOException {Map<BytesRef, Integer> classCounts = new HashMap<>();Map<BytesRef, Double> classBoosts = new HashMap<>(); // this is a boost based on class ranking positions in topDocs@@ -227,4 +233,4 @@ public class KNearestNeighborClassifier implements Classifier<BytesRef> {}return returnList;}-}+}\ No newline at end of file