Accuracy, Recall , Precision, & F1 Score | Model Evaluation Metrics

Accuracy: Accuracy is the most intuitive performance metric, it is simply the ratio of correctly predicted observations to total observations.

Accuracy = correctly predicted observations / total observations.

Accuracy = TP + TN / TP + FP + FN + TN

Some people may think that if we have high Accuracy, then our model is the best.

Yes, accuracy is a great measure but only when you have symmetric datasets where values of false positive and false negatives are almost the same.

Therefore, you must review other parameters to evaluate the performance of the model. 

Precision: Precision is the ratio of correctly predicted positive observations of the total predicted positive observations. 

Precision = predicted positive observations / total predicted positive observations. 

Precision = TP/TP+FP

Recall (Sensitivity): The recall is the ratio of the positive observations correctly predicted to all observations in the actual class – yes. 

Recall = TP / TP + FN

F1 Score – The F1 score is the weighted average of Precision and Recall.

F1 score = 2 * (recall * accuracy) / (recall + accuracy)

Therefore, the score takes into account false positives and false negatives. Intuitively it’s not as easy to understand as accuracy, but F1 is usually more useful than accuracy, especially if you have uneven class distribution.

Point to be Noted: Accuracy is best if false positives and false negatives have similar costs. If the cost of false positives and false negatives is very different, then it’s best to look at Precision and Recall at the same time.