I am working on a model and running some experiments, I see that under some configurations, The accuracy rises while the recall and precision are much lower, what is the mathematical explanation? is the TN rate dropping?


The explanation is simple, assume you have the following values:

True Positives (TP) = 1
True Negatives (TN) = 998
False Positives (FP) = 1
False Negatives (FN) = 1

Accuracy = (TP + TN) / (TP + TN + FP + FN) = 999/1001 = 0.998
Precision = TP / (TP + FP) = 1/2 = 0.5
Recall = TP / (TP + FN) = 1/2 = 0.5

In summary you have an unbalanced dataset i.e. the number of samples of class is much larger than the number of the other classes. So predicting that every sample belongs to class results in a high accuracy value.

  • $\begingroup$ the dataset is equally balanced, and the question in how on the same dataset, can it happen, meaning, training two times on the same data $\endgroup$ – thebeancounter Jul 17 '18 at 13:52
  • $\begingroup$ what do you mean by two times? please edit your question accordingly. $\endgroup$ – Dani Mesejo Jul 17 '18 at 14:20

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.