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 class
ConfusionMatrixGenerator.ConfusionMatrix
a confusion matrix, backed by aMap
representing the linearized matrix
-
Method Summary
All Methods Static Methods Concrete Methods Modifier and Type Method Description static <T> ConfusionMatrixGenerator.ConfusionMatrix
getConfusionMatrix(IndexReader reader, Classifier<T> classifier, String classFieldName, String textFieldName, long timeoutMilliseconds)
get theConfusionMatrixGenerator.ConfusionMatrix
of 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.ConfusionMatrix
of a givenClassifier
, generated on the givenIndexReader
, class and text fields.- Type Parameters:
T
- the return type of theClassificationResult
returned by the givenClassifier
- Parameters:
reader
- theIndexReader
containing the index used for creating theClassifier
classifier
- theClassifier
whose 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
-
-