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.