U
- the class label typepublic class ConfusionMatrix<U> extends Object
Modifier and Type | Class and Description |
---|---|
class |
ConfusionMatrix.Contingency
Contingency table, listing precision ,recall, specificity, and f1 given
the number of true and false positives, true and false negatives.
|
Modifier and Type | Field and Description |
---|---|
protected DecimalFormat |
format |
Constructor and Description |
---|
ConfusionMatrix() |
ConfusionMatrix(Locale locale) |
Modifier and Type | Method and Description |
---|---|
void |
add(U guess,
U gold)
Increments the entry for this guess and gold by 1.
|
void |
add(U guess,
U gold,
int increment)
Increments the entry for this guess and gold by the given increment amount.
|
Integer |
get(U guess,
U gold)
Retrieves the number of entries with this guess and gold.
|
ConfusionMatrix.Contingency |
getContingency(U positiveLabel)
Returns the contingency table for the given class label, where all other
class labels are treated as negative.
|
String |
getPlaceHolder(int index,
U label) |
String |
printTable()
Prints the current confusion in table form to a string, with contingency
|
void |
setDelimPadSize(int newPadSize)
Sets the width used to separate cells in the table.
|
void |
setLeftPadSize(int newPadSize)
This sets the lefthand side pad width for displaying the text table.
|
void |
setUseRealLabels(boolean useRealLabels) |
String |
toString() |
Set<U> |
uniqueLabels()
Returns the set of distinct class labels
entered into this confusion table.
|
protected DecimalFormat format
public ConfusionMatrix()
public ConfusionMatrix(Locale locale)
public void setLeftPadSize(int newPadSize)
newPadSize
- public void setDelimPadSize(int newPadSize)
public void setUseRealLabels(boolean useRealLabels)
public void add(U guess, U gold, int increment)
public Set<U> uniqueLabels()
public ConfusionMatrix.Contingency getContingency(U positiveLabel)
public String printTable()