som.nn.accuracy {som.nn}R Documentation

Calculate accuracy measures

Description

Calculates the sensitivity, specificity and overall accuracy for a prediction result if the corresponding vector of true class labels is provided.

Usage

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

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

Sensitivity is the classifier's ability to correctly identify samples of a specific class A. It is defined as

sens_{A} = TP_{A} / (TP_{A} + FN_{A})

with TP = true positives and FN = false negatives. This is equivalent to the ratio of (correctly identified samples of class A) / (total number of samples of class A).

Specificity is the classifier's ability to correctly identify samples not of a specific class A. It is defined as

spec_{A} = TN_{A} / (TN_{A} + FP_{A})

with TN = true negatives and FP = false positives. This is equivalent to the ratio of (correctly identified samples not in class A) / (total number of samples not in class A).

Accuracy is the classifier's ability to correctly classify samples of a specific class A. It is defined as

acc_{A} = (TP_{A} + TN_{A}) / total

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).

Value

data.frame containing sensitivity, specificity and accuracy for all class labels in the data set.


[Package som.nn version 1.4.4 Index]