Learn R Programming

som.nn (version 1.4.4)

som.nn.confusion: Calculate confusion matrix

Description

Calculates the confusion matrix for a prediction result if the corresponding vector of true class labels is provided.

Usage

som.nn.confusion(x, class.labels)

Value

data.frame containing the confusion matrix.

Arguments

x

data.frame with the predictions as returned by the SOM.nn predict method.

class.labels

vector of correct class labels for the predictions.

Details

The confusion matrix (also called table of confusion) displays the number of predicted class labels for each actual class. Example:

pred. catpred. dogpred. rabbitunknown
actual cat5300
actual dog2310
actual rabbit0292

The confusion matrix includes a column unknown displaying the samples for which no unambiguous prediction is possible.