Public Member Functions |
| ConfusionMatrix () |
| Create an empty confusion matrix that can later be resized with resize().
|
| ConfusionMatrix (const ConfusionMatrix &other) |
| create a confusion matrix using the attribute values of another matrix
|
| ConfusionMatrix (size_t numClasses) |
| Create a confusion matrix of size numClasses × numClasses with zero initial values.
|
| ConfusionMatrix (size_t numClasses, std::vector< LabelType > ignoredLabels) |
| Create a confusion matrix of size numClasses x numClasses and sets which labels should be ignored in the calculations.
|
ConfusionMatrix & | operator= (const ConfusionMatrix &other) |
| copies the attribute values of another confusion matrix
|
void | reset () |
| Reset all per-class counters to zero.
|
void | resize (unsigned int numClasses) |
| Resize the confusion matrix.
|
bool | isNormalized () const |
void | operator+= (const ConfusionMatrix &other) |
| adds the data values of another confusion matrix
|
cuv::reference< double,
cuv::host_memory_space > | operator() (int label, int prediction) |
double | operator() (int label, int prediction) const |
void | increment (int label, int prediction) |
| Increment the counter in the matrix for the given label and the prediction.
|
unsigned int | getNumClasses () const |
void | normalize () |
| Normalizes the confusion matrix such that the sum of the predictions equals one for every label (class).
|
double | averageClassAccuracy (bool includeVoid=true) const |
| Calculate the average per-class accuracy which is equal to the average over the diagonal.
|
Helper class to maintain a n×n confusion matrix.
Construction of the confusion matrix is usually a two-phase process.
- Increment the label/prediction counters
- Normalize the confusion matrix such that the sum over the predictions for every class is 1.
Definition at line 20 of file predict.h.