This post will visually describe the problem of understanding of such concepts as Accuracy, Precision, Recall, F1-Score, ROC Curve, and AUC, which are part of the development of any classification, detection, segmentation, etc. tasks in machine learning. All the images were created by the author.

I would also suggest you read the following articles about those metrics, which are highly informative and could give you a better understanding of the metrics evaluation process:

The Key Element

The key element of all these metrics is True Positive (TP), True Negative (TN), False Positive (FP), and False Negative (FN) metrics, which came from Statistics, specifically from Hypothesis Testing.

Confusion Matrix
  • True Positive is about how many positive samples were classified as positive.
  • True Negative is about how many negative samples were classified as negative.
  • False Positive is about how many negative samples were classified as positive.
  • False Negative is about how many positive samples were classified as negative.

Accuracy

Accuracy shows how many correct classifications you have made.

Accuracy

Precision

Precision shows how many positive predictions were correct.

Precision

Recall

Recall shows how many predictions were correct across the only positive samples.

Recall

F1-Score

F1-Score is simply the harmonic mean between Precision and Recall.

F1-Score

ROC Curve

ROC Curve stands for “Receiver Operating Characteristic” and depends on two parameters:

  1. True Positive Rate (TPR), also known as Recall.
  2. False Positive Rate (FPR), which is the probability of an actual negative class to be predicted as positive.
False Positive Rate

Using different threshold values from 0 to 1, a ROC Curve is created by plotting FPR values on the X-axis, and TPR values on the Y-axis.

ROC Curve

AUC

AUC stands for “Area under the ROC Curve” and measures the entire two-dimensional area underneath the entire ROC curve from (0,0) to (1,1).

AUC

Conclusion

These metrics are widely used in different machine learning topics, so it is required to get a clear intuition about how they work, how to interpret, and, finally, how to raise them to 100%.