Accuracy | Precision | Recall | F-Measure - Analyzing your Confusion Matrix

When we are going through the Confusion Matrix, there are a lot many things that we can unearth like the type 1 error, type 2 error, accuracy, precision, recall, f-measure, etc. which helps us to understand the model performance. Please visit my earlier post where I have covered about the confusion matrix, type 1 and type 2 errors. In this post, let us understand the precision, recall, accuracy and f-measure from a confusion matrix and their significance on a model.

Accuracy

It is the ratio of the sum of correctly identified classes to the sum of all the classes.
The correctly identified classes are the ones which are -
  1. Predicted positive provided they are actually positive i.e. True Positive.
  2. Predicted negative provided they are actually negative i.e. True Negative.

Precision

It is the ratio of the correctly identified positive classes to the sum of the predicted positive classes.
The predicted positive classes are the ones which are -
  1. Predicted positive provided they are actually positive i.e. True Positive.
  2. Predicted positive provided they are actually negative i.e. False Positive.
This ratio provides information that out of all the positive classes we have predicted correctly, how many are actually positive.

Recall

It is the ratio of the correctly identified positive classes to the sum of the actual positive classes.
The actual positive classes are the ones which are -
  1. Predicted positive provided they are actually positive i.e. True Positive.
  2. Predicted negative provided they are actually positive i.e. False Negative.
This ratio provides the information that out of all the positive classes, how much we predicted correctly.

F-Measure

The F-Measure is also known as the F1-Score or the F-Score. It is a measure if a test's accuracy. We make use of this F-score in order to compare two models. F-measure considers recall and precision at the same time. It makes use of the harmonic mean instead of arithmetic mean to take care of the extreme values.
Above image provides a summary of what we have discussed in this post. Hope this post gives you the clarity pertaining to the different measures that are derived from a confusion matrix.

Comments