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 |
class_error(int c) |
double |
err_count() |
double |
err() |
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() |
double |
total_rows() |
clone, copyOver, frozenType, read_impl, read, readExternal, readJSON_impl, readJSON, toJsonString, write_impl, write, writeExternal, writeJSON_impl, writeJSONpublic 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 class_error(int c)
public double total_rows()
public void add(ConfusionMatrix other)
public double err()
public double err_count()
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.Objectpublic java.lang.String toASCII()
public TwoDimTable table()