javax.datamining.supervised.classification
Interface ConfusionMatrix

All Superinterfaces:
CategoryMatrix

public interface ConfusionMatrix
extends CategoryMatrix

ConfusionMatrix specifies the statistics of the correct predictions and mispredictions. The rows represent the actual classes whereas the columns indicate the predicted class values. The value at entry (j, k) is the number of predictions made for class j when k is the predicted class.

Author:
JSR-73 Java Data Mining Expert Group
See Also:
CategoryMatrix

Method Summary
 double getAccuracy()
          Returns the ratio of the sum of the diagonal entries to the sum of all entries.
 double getError()
          Returns the sum of the non-diagonal sums where the actual value does not euqal to predicted value, divided by the sum of all cells times 100.
 long getNumberOfPredictions(java.lang.Object actualCategoryValue, java.lang.Object predictedCategoryValue)
          Returns the number of predictions for the given class when the actual prediction is actualCategory.
 
Methods inherited from interface javax.datamining.data.CategoryMatrix
getCategories, getCategorySet, getValue
 

Method Detail

getAccuracy

public double getAccuracy()
Returns the ratio of the sum of the diagonal entries to the sum of all entries. This ratio represents the ratio of the correct predictions to the total predictions times 100.

The returned value must be a value between 0 and 100.

Returns:
double

getError

public double getError()
Returns the sum of the non-diagonal sums where the actual value does not euqal to predicted value, divided by the sum of all cells times 100.

The returned value must be a value between 0 and 100.

Returns:
double

getNumberOfPredictions

public long getNumberOfPredictions(java.lang.Object actualCategoryValue,
                                   java.lang.Object predictedCategoryValue)
                            throws JDMException
Returns the number of predictions for the given class when the actual prediction is actualCategory.

Parameters:
actualCategoryValue - The actual target value.
predictedCategoryValue - The predicted target value.
Returns:
long
Throws:
JDMException