use of org.apache.lucene.classification.KNearestFuzzyClassifier in project lucene-solr by apache.
the class ConfusionMatrixGeneratorTest method testGetConfusionMatrixWithFLTKNN.
@Test
public void testGetConfusionMatrixWithFLTKNN() throws Exception {
LeafReader reader = null;
try {
MockAnalyzer analyzer = new MockAnalyzer(random());
reader = getSampleIndex(analyzer);
Classifier<BytesRef> classifier = new KNearestFuzzyClassifier(reader, null, analyzer, null, 1, categoryFieldName, textFieldName);
ConfusionMatrixGenerator.ConfusionMatrix confusionMatrix = ConfusionMatrixGenerator.getConfusionMatrix(reader, classifier, categoryFieldName, textFieldName, -1);
checkCM(confusionMatrix);
} finally {
if (reader != null) {
reader.close();
}
}
}
Aggregations