public final class TableOfConfusion extends Object
A data structure for computation of statistical values based on a 2x2 confusion matrix.
Look at the 2x2-case at http://en.wikipedia.org/wiki/Confusion_matrix for detailed descriptions.
ConfusionMatrix| Modifier and Type | Field and Description |
|---|---|
private long |
falseNegative |
private long |
falsePositive |
private long |
trueNegative |
private long |
truePositive |
| Constructor and Description |
|---|
TableOfConfusion() |
| Modifier and Type | Method and Description |
|---|---|
void |
addFalseNegative()
Short form of
addFalseNegative(1). |
void |
addFalseNegative(long delta)
Adds the amount specified by the argument
delta to the
internal data structure for the counting of false negative instances. |
void |
addFalsePositive()
Short form of
addFalsePositive(1). |
void |
addFalsePositive(long delta)
Adds the amount specified by the argument
delta to the
internal data structure for the counting of false positive instances. |
void |
addTrueNegative()
Short form of
addTrueNegative(1). |
void |
addTrueNegative(long delta)
Adds the amount specified by the argument
delta to the
internal data structure for the counting of true negative instances. |
void |
addTruePositive()
Short form of
addTruePositive(1). |
void |
addTruePositive(long delta)
Adds the amount specified by the argument
delta to the
internal data structure for the counting of true positive instances. |
double |
calculateAccuracy()
Calculates and returns the accuracy value.
|
double |
calculateFScore()
Calculates and returns the f-score value.
|
double |
calculatePrecision()
Calculates and returns the precision value.
|
double |
calculateRecall()
Calculates and returns the recall value.
|
double |
calculateSpecificity()
Calculates and returns the specificity value.
|
String |
toString()
Returns a String representation of this table of confusion.
|
String |
toStringOld() |
private long truePositive
private long trueNegative
private long falsePositive
private long falseNegative
public void addTruePositive()
addTruePositive(1).public void addTruePositive(long delta)
delta to the
internal data structure for the counting of true positive instances.delta - The amount to add to the true positive counterpublic void addTrueNegative()
addTrueNegative(1).public void addTrueNegative(long delta)
delta to the
internal data structure for the counting of true negative instances.delta - The amount to add to the true negative counterpublic void addFalsePositive()
addFalsePositive(1).public void addFalsePositive(long delta)
delta to the
internal data structure for the counting of false positive instances.delta - The amount to add to the false positive counterpublic void addFalseNegative()
addFalseNegative(1).public void addFalseNegative(long delta)
delta to the
internal data structure for the counting of false negative instances.delta - The amount to add to the false negative counterpublic double calculatePrecision()
public double calculateRecall()
public double calculateSpecificity()
public double calculateAccuracy()
public double calculateFScore()
public String toString()
public String toStringOld()
Copyright © 2018. All rights reserved.