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?
1 Answer
$\begingroup$
$\endgroup$
2
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$ Commented Jul 17, 2018 at 13:52
-
$\begingroup$ what do you mean by two times? please edit your question accordingly. $\endgroup$ Commented Jul 17, 2018 at 14:20