Question - How to calculate the accuracy of a binary classification algorithm using its confusion matrix?
Answer -
In a binary classification algorithm, we have only two labels, which are True and False. Before we can calculate the accuracy, we need to understand a few key terms:
- True positives: Number of observations correctly classified as True
- True negatives: Number of observations correctly classified as False
- False positives: Number of observations incorrectly classified as True
- False negatives: Number of observations incorrectly classified as False
To calculate the accuracy, we need to divide the sum of the correctly classified observations by the number of total observations. This can be expressed as follows: