Calculates the accuracy over all class lables for a prediction result if the corresponding vector of true class labels is provided.
som.nn.all.accuracy(x, class.labels)one value overall accuracy.
data.frame with the predictions as returned by the
SOM.nn predict method.
vector of correct class labels for the predictions.
It is defined as
$$acc = (TP + TN) / total = sum(diag(cmat)) / sum(cmat)$$
with TP = true positives, TN = true negatives and total = total number of samples of a class. This is equivalent to the ratio of (correctly classified samples) / (total number of samples).