|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectde.jstacs.classifier.ConfusionMatrix
public class ConfusionMatrix
This class holds the confusion matrix of a classifier.
| Constructor Summary | |
|---|---|
ConfusionMatrix(int classes)
Creates a new ConfusionMatrix with a given number of classes. |
|
ConfusionMatrix(StringBuffer representation)
The standard constructor for the interface Storable. |
|
| Method Summary | |
|---|---|
void |
add(int realClass,
int predictedClass)
This method updates the confusion matrix. |
double |
getClassificationRate()
This method returns the classification rate. |
int |
getCountsFor(int predictedClass,
int realClass)
This method returns the specific entry of the ConfusionMatrix. |
int[][] |
getMatrix()
This method returns the confusion matrix as a two dimensional int-array. |
double |
getMisclassificationRate()
This method returns the misclassification rate. |
StringBuffer |
toXML()
This method returns an XML representation as StringBuffer of an
instance of the implementing class. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ConfusionMatrix(int classes)
ConfusionMatrix with a given number of classes.
classes - the number of classes
public ConfusionMatrix(StringBuffer representation)
throws NonParsableException
Storable.
Creates a new ConfusionMatrix out of its XML representation.
representation - the XML representation as StringBuffer
NonParsableException - if the ConfusionMatrix could not be reconstructed out
of the XML representation (the StringBuffer
representation could not be parsed)Storable| Method Detail |
|---|
public void add(int realClass,
int predictedClass)
realClass - the real class indexpredictedClass - the predicted class indexpublic int[][] getMatrix()
int-array.
public double getClassificationRate()
public double getMisclassificationRate()
public int getCountsFor(int predictedClass,
int realClass)
ConfusionMatrix.
predictedClass - the index of the predicted classrealClass - the index of the real class
ConfusionMatrixpublic StringBuffer toXML()
StorableStringBuffer of an
instance of the implementing class.
toXML in interface Storable
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||