CategoryType
- The type of the categories the confusion matrix is computed over.public interface ConfusionMatrix<CategoryType> extends CloneableSerializable
Modifier and Type | Method and Description |
---|---|
void |
add(CategoryType actual,
CategoryType predicted)
Adds a count of one to the matrix entry for the (actual, predicted)
pair.
|
void |
add(CategoryType actual,
CategoryType predicted,
double value)
Adds a given value to the matrix entry for the (actual, predicted)
pair.
|
<OtherType extends CategoryType> |
addAll(ConfusionMatrix<OtherType> other)
Adds all of the values in the given confusion matrix to this confusion
matrix.
|
void |
clear()
Empties out all the data in this confusion matrix.
|
double |
getAccuracy()
The accuracy value of the entire confusion matrix.
|
java.util.Set<CategoryType> |
getActualCategories()
Gets the set of all the actual categories.
|
double |
getActualCount(CategoryType actual)
Gets the total number of entries for the given actual category.
|
double |
getAverageCategoryAccuracy()
The average accuracy value for the categories in the confusion
matrix.
|
double |
getAverageCategoryErrorRate()
The average error rate for the actual categories in the confusion
matrix.
|
java.util.Set<CategoryType> |
getCategories()
Gets the set of all categories in the confusion matrix.
|
double |
getCategoryAccuracy(CategoryType category)
The category accuracy value for the confusion matrix.
|
double |
getCategoryErrorRate(CategoryType category)
The category error rate for the confusion matrix.
|
double |
getCount(CategoryType actual,
CategoryType predicted)
Gets the entry in the matrix for the given actual and predicted
categories, which is the count of the number of times the predicted
category was given for the given actual category.
|
double |
getErrorRate()
The error rate of the entire confusion matrix.
|
java.util.Set<CategoryType> |
getPredictedCategories()
Gets the set of all the predicted categories.
|
java.util.Set<CategoryType> |
getPredictedCategories(CategoryType actual)
Gets the predicted categories for a given actual category.
|
double |
getPredictedCount(CategoryType predicted)
Gets the total number of entries for the given predicted category.
|
double |
getTotalCorrectCount()
Gets the total number of correct entries in the confusion matrix.
|
double |
getTotalCount()
Gets the total number of entries in the confusion matrix.
|
double |
getTotalIncorrectCount()
Gets the total number of incorrect entries in the confusion matrix.
|
boolean |
isEmpty()
Gets whether or not the matrix is empty.
|
clone
void add(CategoryType actual, CategoryType predicted)
actual
- The actual category.predicted
- The predicted category.void add(CategoryType actual, CategoryType predicted, double value)
actual
- The actual category.predicted
- The predicted category.value
- The value to add.<OtherType extends CategoryType> void addAll(ConfusionMatrix<OtherType> other)
OtherType
- The type of values in the other matrix, which must extend the type
of value in this matrix. Typically these will be the same.other
- The other confusion matrix to add all of its values to this one.double getCount(CategoryType actual, CategoryType predicted)
actual
- The actual category.predicted
- The predicted category.double getActualCount(CategoryType actual)
actual
- The actual category.double getPredictedCount(CategoryType predicted)
predicted
- The predicted category.void clear()
boolean isEmpty()
double getTotalCount()
double getTotalCorrectCount()
double getTotalIncorrectCount()
getTotalCount() - getTotalCorrectCount()
.double getAccuracy()
double getCategoryAccuracy(CategoryType category)
category
- The category to get the accuracy for.double getAverageCategoryAccuracy()
double getErrorRate()
double getCategoryErrorRate(CategoryType category)
category
- The category to get the error rate for.double getAverageCategoryErrorRate()
java.util.Set<CategoryType> getCategories()
java.util.Set<CategoryType> getActualCategories()
java.util.Set<CategoryType> getPredictedCategories()
java.util.Set<CategoryType> getPredictedCategories(CategoryType actual)
actual
- The actual category to get the set of prediction categories for.