Accuracy is defined as the percentage of correct predictions out of all the observations.
A prediction is said to be correct if it matches reality
Example:-
Here we have two conditions in which the Prediction matches with the Reality, i.e., True Positive and True Negative. Therefore, the Formula for Accuracy is
Where TP = True Positives, TN = True Negatives, FP = False Positives, and FN = False Negatives.