Class ConfusionMatrixGenerator
- java.lang.Object
-
- org.apache.lucene.classification.utils.ConfusionMatrixGenerator
-
public class ConfusionMatrixGenerator extends java.lang.ObjectUtility 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
-
Constructor Summary
Constructors Modifier Constructor Description privateConfusionMatrixGenerator()
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ConfusionMatrixGenerator.ConfusionMatrixgetConfusionMatrix(IndexReader reader, Classifier<T> classifier, java.lang.String classFieldName, java.lang.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, java.lang.String classFieldName, java.lang.String textFieldName, long timeoutMilliseconds) throws java.io.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:
java.io.IOException- if problems occurr while reading the index or using the classifier
-
-