public static class ConfusionMatrixGenerator.ConfusionMatrix
extends java.lang.Object
Map
representing the linearized matrixModifier and Type | Method and Description |
---|---|
double |
getAccuracy()
Calculate accuracy on this confusion matrix using the formula:
accuracy = correctly-classified / (correctly-classified + wrongly-classified)
|
double |
getAvgClassificationTime()
get the average classification time in milliseconds
|
double |
getF1Measure()
get the F-1 measure on this confusion matrix
|
double |
getF1Measure(java.lang.String klass)
get the F-1 measure of the given class
|
java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> |
getLinearizedMatrix()
get the linearized confusion matrix as a
Map |
int |
getNumberOfEvaluatedDocs()
get the no.
|
double |
getPrecision()
get the macro averaged precision (see
getPrecision(String) ) over all the classes. |
double |
getPrecision(java.lang.String klass)
calculate precision on the given class
|
double |
getRecall()
get the macro averaged recall (see
getRecall(String) ) over all the classes |
double |
getRecall(java.lang.String klass)
calculate recall on the given class
|
java.lang.String |
toString() |
public java.util.Map<java.lang.String,java.util.Map<java.lang.String,java.lang.Long>> getLinearizedMatrix()
Map
Map
whose keys are the correct classification answers and whose values are the actual answers'
countspublic double getPrecision(java.lang.String klass)
klass
- the class to calculate the precision forpublic double getRecall(java.lang.String klass)
klass
- the class to calculate the recall forpublic double getF1Measure(java.lang.String klass)
klass
- the class to calculate the F-1 measure forpublic double getF1Measure()
public double getAccuracy()
public double getPrecision()
getPrecision(String)
) over all the classes.public double getRecall()
getRecall(String)
) over all the classespublic java.lang.String toString()
toString
in class java.lang.Object
public double getAvgClassificationTime()
public int getNumberOfEvaluatedDocs()
Copyright © 2000–2019 The Apache Software Foundation. All rights reserved.