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
|
double |
mean_per_class_accuracy() |
double |
mean_per_class_error() |
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() |
asBytes, clone, copyOver, frozenType, read, readExternal, readJSON, reloadFromBytes, toJsonString, write, writeExternal, 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 mean_per_class_error()
public final double mean_per_class_accuracy()
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.Object
public java.lang.String toASCII()
public TwoDimTable table()