Class ConfusionMatrixGenerator
- java.lang.Object
-
- org.apache.lucene.classification.utils.ConfusionMatrixGenerator
-
public class ConfusionMatrixGenerator extends Object
Utility class to generate the confusion matrix of aClassifier
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classConfusionMatrixGenerator.ConfusionMatrixa confusion matrix, backed by aMaprepresenting the linearized matrix
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ConfusionMatrixGenerator.ConfusionMatrixgetConfusionMatrix(IndexReader reader, Classifier<T> classifier, String classFieldName, String textFieldName, long timeoutMilliseconds)get theConfusionMatrixGenerator.ConfusionMatrixof a givenClassifier, generated on the givenIndexReader, class and text fields.
-
-
-
Method Detail
-
getConfusionMatrix
public static <T> ConfusionMatrixGenerator.ConfusionMatrix getConfusionMatrix(IndexReader reader, Classifier<T> classifier, String classFieldName, String textFieldName, long timeoutMilliseconds) throws IOException
get theConfusionMatrixGenerator.ConfusionMatrixof a givenClassifier, generated on the givenIndexReader, class and text fields.- Type Parameters:
T- the return type of theClassificationResultreturned by the givenClassifier- Parameters:
reader- theIndexReadercontaining the index used for creating theClassifierclassifier- theClassifierwhose confusion matrix has to be generatedclassFieldName- the name of the Lucene field used as the classifier's outputtextFieldName- the nome the Lucene field used as the classifier's inputtimeoutMilliseconds- timeout to wait before stopping creating the confusion matrix- Returns:
- a
ConfusionMatrixGenerator.ConfusionMatrix - Throws:
IOException- if problems occurr while reading the index or using the classifier
-
-