mirror of https://github.com/apache/lucene.git
[LUCENE-4345] - fixed javadoc
git-svn-id: https://svn.apache.org/repos/asf/lucene/dev/trunk@1401692 13f79535-47bb-0310-9956-ffa450edef68
This commit is contained in:
parent
ec9a50132a
commit
629092bc13
|
@ -19,21 +19,35 @@ package org.apache.lucene.classification;
|
|||
|
||||
/**
|
||||
* The result of a call to {@link Classifier#assignClass(String)} holding an assigned class and a score.
|
||||
* @lucene.experimental
|
||||
*/
|
||||
public class ClassificationResult {
|
||||
|
||||
private String assignedClass;
|
||||
private double score;
|
||||
|
||||
/**
|
||||
* Constructor
|
||||
* @param assignedClass the class <code>String</code> assigned by a {@link Classifier}
|
||||
* @param score the score for the assignedClass as a <code>double</code>
|
||||
*/
|
||||
public ClassificationResult(String assignedClass, double score) {
|
||||
this.assignedClass = assignedClass;
|
||||
this.score = score;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieve the result class
|
||||
* @return a <code>String</code> representing an assigned class
|
||||
*/
|
||||
public String getAssignedClass() {
|
||||
return assignedClass;
|
||||
}
|
||||
|
||||
/**
|
||||
* retrieve the result score
|
||||
* @return a <code>double</code> representing a result score
|
||||
*/
|
||||
public double getScore() {
|
||||
return score;
|
||||
}
|
||||
|
|
|
@ -43,6 +43,10 @@ public class KNearestNeighborClassifier implements Classifier {
|
|||
private IndexSearcher indexSearcher;
|
||||
private int k;
|
||||
|
||||
/**
|
||||
* Create a {@link Classifier} using kNN algorithm
|
||||
* @param k the number of neighbors to analyze as an <code>int</code>
|
||||
*/
|
||||
public KNearestNeighborClassifier(int k) {
|
||||
this.k = k;
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue