public abstract class AbstractBinaryConfusionMatrix extends AbstractConfusionMatrix<java.lang.Boolean> implements BinaryConfusionMatrix
BinaryConfusionMatrix
interface.
Takes care of a lot of the general operations from the interface so that
extending classes only need to focus on the data structure implementation.Constructor and Description |
---|
AbstractBinaryConfusionMatrix()
Creates a new
AbstractBinaryConfusionMatrix . |
Modifier and Type | Method and Description |
---|---|
java.util.Set<java.lang.Boolean> |
getActualCategories()
Gets the set of all the actual categories.
|
double |
getActualCount(java.lang.Boolean target)
Gets the total number of entries for the given actual category.
|
java.util.Set<java.lang.Boolean> |
getCategories()
Gets the set of all categories in the confusion matrix.
|
double |
getCount(java.lang.Boolean target,
java.lang.Boolean estimate)
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 |
getFalseNegativesFraction()
Gets the fraction of false negatives.
|
double |
getFalsePositivesFraction()
Gets the fraction of false positives.
|
double |
getFScore()
The F-score of the confusion matrix, which is also known as the
F1-score or F-measure.
|
double |
getFScore(double beta)
The F-score for the confusion matrix with the given trade-off parameter
(beta).
|
double |
getPrecision()
The precision value for the confusion matrix.
|
java.util.Set<java.lang.Boolean> |
getPredictedCategories()
Gets the set of all the predicted categories.
|
java.util.Set<java.lang.Boolean> |
getPredictedCategories(java.lang.Boolean target)
Gets the predicted categories for a given actual category.
|
double |
getRecall()
The recall value for the confusion matrix.
|
double |
getSensitivity()
The sensitivity value for the confusion matrix.
|
double |
getSpecificity()
The specificity value for the confusion matrix.
|
double |
getTrueNegativesFraction()
Gets the fraction of true negatives.
|
double |
getTruePositivesFraction()
Gets the fraction of true positives.
|
add, addAll, getAccuracy, getAverageCategoryAccuracy, getAverageCategoryErrorRate, getCategoryAccuracy, getCategoryErrorRate, getErrorRate, getPredictedCount, getTotalCorrectCount, getTotalCount, getTotalIncorrectCount, isEmpty
clone
equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
getFalseNegativesCount, getFalsePositivesCount, getTrueNegativesCount, getTruePositivesCount
add, add, addAll, clear, getAccuracy, getAverageCategoryAccuracy, getAverageCategoryErrorRate, getCategoryAccuracy, getCategoryErrorRate, getErrorRate, getPredictedCount, getTotalCorrectCount, getTotalCount, getTotalIncorrectCount, isEmpty
clone
public AbstractBinaryConfusionMatrix()
AbstractBinaryConfusionMatrix
.public java.util.Set<java.lang.Boolean> getCategories()
ConfusionMatrix
getCategories
in interface ConfusionMatrix<java.lang.Boolean>
public java.util.Set<java.lang.Boolean> getActualCategories()
ConfusionMatrix
getActualCategories
in interface ConfusionMatrix<java.lang.Boolean>
public java.util.Set<java.lang.Boolean> getPredictedCategories()
ConfusionMatrix
getPredictedCategories
in interface ConfusionMatrix<java.lang.Boolean>
public java.util.Set<java.lang.Boolean> getPredictedCategories(java.lang.Boolean target)
ConfusionMatrix
getPredictedCategories
in interface ConfusionMatrix<java.lang.Boolean>
target
- The actual category to get the set of prediction categories for.public double getCount(java.lang.Boolean target, java.lang.Boolean estimate)
ConfusionMatrix
getCount
in interface ConfusionMatrix<java.lang.Boolean>
target
- The actual category.estimate
- The predicted category.public double getActualCount(java.lang.Boolean target)
ConfusionMatrix
getActualCount
in interface ConfusionMatrix<java.lang.Boolean>
getActualCount
in class AbstractConfusionMatrix<java.lang.Boolean>
target
- The actual category.public double getTruePositivesFraction()
BinaryConfusionMatrix
getTruePositivesFraction
in interface BinaryConfusionMatrix
public double getFalsePositivesFraction()
BinaryConfusionMatrix
getFalsePositivesFraction
in interface BinaryConfusionMatrix
public double getTrueNegativesFraction()
BinaryConfusionMatrix
getTrueNegativesFraction
in interface BinaryConfusionMatrix
public double getFalseNegativesFraction()
BinaryConfusionMatrix
getFalseNegativesFraction
in interface BinaryConfusionMatrix
public double getSensitivity()
BinaryConfusionMatrix
getSensitivity
in interface BinaryConfusionMatrix
public double getSpecificity()
BinaryConfusionMatrix
getSpecificity
in interface BinaryConfusionMatrix
public double getPrecision()
BinaryConfusionMatrix
getPrecision
in interface BinaryConfusionMatrix
public double getRecall()
BinaryConfusionMatrix
getRecall
in interface BinaryConfusionMatrix
public double getFScore()
BinaryConfusionMatrix
getFScore
in interface BinaryConfusionMatrix
public double getFScore(double beta)
BinaryConfusionMatrix
getFScore
in interface BinaryConfusionMatrix
beta
- The beta value of the score. It is the importance assigned to
precision as compared to recall.