|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectweka.core.Matrix
weka.classifiers.evaluation.ConfusionMatrix
public class ConfusionMatrix
Cells of this matrix correspond to counts of the number (or weight) of predictions for each actual value / predicted value combination.
| Constructor Summary | |
|---|---|
ConfusionMatrix(java.lang.String[] classNames)
Creates the confusion matrix with the given class names. |
|
| Method Summary | |
|---|---|
void |
addPrediction(NominalPrediction pred)
Includes a prediction in the confusion matrix. |
void |
addPredictions(FastVector predictions)
Includes a whole bunch of predictions in the confusion matrix. |
java.lang.String |
className(int index)
Gets the name of one of the classes. |
java.lang.Object |
clone()
Creates and returns a clone of this object. |
double |
correct()
Gets the number of correct classifications (that is, for which a correct prediction was made). |
double |
errorRate()
Returns the estimated error rate. |
java.lang.String |
getRevision()
Returns the revision string. |
TwoClassStats |
getTwoClassStats(int classIndex)
Gets the performance with respect to one of the classes as a TwoClassStats object. |
double |
incorrect()
Gets the number of incorrect classifications (that is, for which an incorrect prediction was made). |
ConfusionMatrix |
makeWeighted(CostMatrix costs)
Makes a copy of this ConfusionMatrix after applying the supplied CostMatrix to the cells. |
int |
size()
Gets the number of classes. |
java.lang.String |
toString()
Calls toString() with a default title. |
java.lang.String |
toString(java.lang.String title)
Outputs the performance statistics as a classification confusion matrix. |
double |
total()
Gets the number of predictions that were made (actually the sum of the weights of predictions where the class value was known). |
| Methods inherited from class weka.core.Matrix |
|---|
add, addElement, eigenvalueDecomposition, getColumn, getElement, getL, getRow, getU, isSymmetric, LUDecomposition, main, multiply, numColumns, numRows, parseMatlab, regression, regression, setColumn, setElement, setRow, solve, toMatlab, transpose, write |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait |
| Constructor Detail |
|---|
public ConfusionMatrix(java.lang.String[] classNames)
classNames - an array containing the names the classes.| Method Detail |
|---|
public ConfusionMatrix makeWeighted(CostMatrix costs)
throws java.lang.Exception
costs - the CostMatrix.
java.lang.Exception - if the CostMatrix is not of the same size
as this ConfusionMatrix.public java.lang.Object clone()
clone in class Matrixpublic int size()
public java.lang.String className(int index)
index - the index of the class.
public void addPrediction(NominalPrediction pred)
throws java.lang.Exception
pred - the NominalPrediction to include
java.lang.Exception - if no valid prediction was made (i.e.
unclassified).
public void addPredictions(FastVector predictions)
throws java.lang.Exception
predictions - a FastVector containing the NominalPredictions
to include
java.lang.Exception - if no valid prediction was made (i.e.
unclassified).public TwoClassStats getTwoClassStats(int classIndex)
classIndex - the index of the class of interest.
public double correct()
public double incorrect()
public double total()
public double errorRate()
public java.lang.String toString()
toString in class Matrixpublic java.lang.String toString(java.lang.String title)
title - the title for the confusion matrix
public java.lang.String getRevision()
getRevision in interface RevisionHandlergetRevision in class Matrix
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||