Friday, July 28, 2017

How to use confusion matrix to calculate accuracy, precision, recall, and f1 score

Accuracy = (TP + TN) / (TP + TN + FP + FN)
Precision = TP / (TP + FP)
Recall = TP / (TP + FN)
F1 Score = 2 * Precision * Recall / (Precision + Recall)

TP = # True Positives, TN = # True Negatives, FP = # False Positives, FN = # False Negatives

No comments:

Post a Comment