|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectnet.sf.myra.datamining.ConfusionMatrix
public final class ConfusionMatrix
This class represents a confusion matrix implementation.
Field Summary | |
---|---|
static int |
FN
The false negative's index. |
static int |
FP
The false positive's index. |
static int |
TN
The true negative's index. |
static int |
TP
The true positive's index. |
Constructor Summary | |
---|---|
ConfusionMatrix()
Default constructor. |
|
ConfusionMatrix(double tp,
double fp,
double fn,
double tn)
Creates a new ConfusionMatrix instance. |
Method Summary | |
---|---|
void |
add(ConfusionMatrix other)
Adds the values from the specified confusion matrix. |
void |
add(int field,
double value)
Adds the value to the specified cell. |
ConfusionMatrix |
clone()
|
double |
get(int field)
Returns the value of the specified cell. |
double |
getAccuracy()
Returns the accuracy value. |
double |
getPrecision()
Returns the precision value. |
double |
getRecall()
Returns the recall value. |
double |
getSensitivity()
Returns the sensitivity value. |
double |
getSpecificity()
Returns the specificity value. |
void |
increment(int field)
Increments the specified cell in the matrix. |
void |
set(int field,
double value)
Sets the value of the specified cell. |
java.lang.String |
toString()
|
Methods inherited from class java.lang.Object |
---|
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int TP
public static final int FP
public static final int TN
public static final int FN
Constructor Detail |
---|
public ConfusionMatrix()
public ConfusionMatrix(double tp, double fp, double fn, double tn)
ConfusionMatrix
instance.
tp
- true positive initial value.fp
- false positive initial value.fn
- false negative initial value.tn
- true negative initial value.Method Detail |
---|
public void add(ConfusionMatrix other)
other
- the confusion matrix the add.public void add(int field, double value)
field
- the cell of the matrix.value
- the value to add.public void increment(int field)
field
- the cell to increment.public double get(int field)
field
- the cell.
public void set(int field, double value)
field
- the field to set.value
- the value to set.public double getSensitivity()
public double getSpecificity()
public double getPrecision()
public double getRecall()
public double getAccuracy()
public java.lang.String toString()
toString
in class java.lang.Object
public ConfusionMatrix clone()
clone
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |