public class ConfusionMatrix extends Iced
Modifier and Type | Field and Description |
---|---|
double[][] |
_cm |
java.lang.String[] |
_domain |
Constructor and Description |
---|
ConfusionMatrix(double[][] value,
java.lang.String[] domain)
Constructor for Confusion Matrix
|
Modifier and Type | Method and Description |
---|---|
double |
accuracy()
The percentage of predictions that are correct.
|
void |
add(ConfusionMatrix other) |
void |
add(int i,
int j) |
static ConfusionMatrix |
buildCM(Vec actuals,
Vec predictions)
Build the CM data from the actuals and predictions, using the default
threshold.
|
double |
classErr(int c) |
double |
err() |
long |
errCount() |
double |
F0point5()
Returns the F-measure which combines precision and recall and weights precision higher than recall.
|
double |
F1()
Returns the F-measure which combines precision and recall.
|
double |
F2()
Returns the F-measure which combines precision and recall and weights recall higher than precision.
|
boolean |
isBinary() |
double |
max_per_class_error()
The maximum per-class error
|
double |
mcc()
The Matthews Correlation Coefficient, takes true negatives into account in contrast to F-Score
See MCC
MCC = Correlation between observed and predicted binary classification
|
int |
nclasses() |
double |
precision()
The percentage of positive predictions that are correct.
|
double |
recall()
The percentage of positive labeled instances that were predicted as positive.
|
int |
size() |
double |
specificity()
The percentage of negative labeled instances that were predicted as negative.
|
TwoDimTable |
table()
Convert this ConfusionMatrix into a fully annotated TwoDimTable
|
java.lang.String |
toASCII() |
java.lang.String |
toString() |
long |
totalRows() |
clone, frozenType, read_impl, read, readExternal, readJSON_impl, readJSON, toJsonString, write_impl, write, writeExternal, writeHTML_impl, writeHTML, writeJSON_impl, writeJSON
public ConfusionMatrix(double[][] value, java.lang.String[] domain)
value
- 2D square matrix with co-occurrence counts for actual vs predicted class membershipdomain
- class labels (unified domain between actual and predicted class labels)public static ConfusionMatrix buildCM(Vec actuals, Vec predictions)
public void add(int i, int j)
public final int size()
public final double classErr(int c)
public long totalRows()
public void add(ConfusionMatrix other)
public double err()
public long errCount()
public double accuracy()
public double specificity()
public double recall()
public double precision()
public double mcc()
public double max_per_class_error()
public final int nclasses()
public final boolean isBinary()
public double F1()
public double F2()
public double F0point5()
public java.lang.String toString()
toString
in class java.lang.Object
public java.lang.String toASCII()
public TwoDimTable table()