Calculates the confusion matrix for a prediction result if the corresponding vector of true class labels is provided.
som.nn.confusion(x, class.labels)
data.frame
containing the confusion matrix.
data.frame
with the predictions as returned by the
SOM.nn predict method.
vector
of correct class labels for the predictions.
The confusion matrix (also called table of confusion) displays the number of predicted class labels for each actual class. Example:
pred. cat | pred. dog | pred. rabbit | unknown | |
actual cat | 5 | 3 | 0 | 0 |
actual dog | 2 | 3 | 1 | 0 |
actual rabbit | 0 | 2 | 9 | 2 |
The confusion matrix includes a column unknown
displaying the samples
for which no unambiguous prediction is possible.