2
$\begingroup$

I am training a neural network classifier with 250k training samples and 54k validation samples. The output activation is sigmoid. I noticed a sudden drop in the precision for the very top probability scores. The graph looks as below. Any advice about a possible cause? enter image description here

$\endgroup$
5
  • $\begingroup$ What is the highest predicted value to which you apply the threshold? $\endgroup$
    – Dave
    Commented Aug 24, 2023 at 17:19
  • 1
    $\begingroup$ If i got your question correctly, the highest predicted score is around 0.99. The rate of positive labels is 3.4%. $\endgroup$
    – Florian
    Commented Aug 24, 2023 at 17:23
  • $\begingroup$ What if you zoom the vertical axis to be more like $0$ to $0.1$ or $0.01?$ I’m curious if you wind up with just a few positive classifications at such a threshold, leading to precision and recall values that are not visually distinguishable from zero in the current plot. $\endgroup$
    – Dave
    Commented Aug 24, 2023 at 17:25
  • $\begingroup$ There are few samples 5-10 with very high proba scores but I would have expected precision to continue an upward trend at scores above 0.9. Instead it suddenly decreases and above 0.92 it goes to zero. $\endgroup$
    – Florian
    Commented Aug 24, 2023 at 17:34
  • $\begingroup$ You’ve eyeballed that it goes to zero on the graph, or you’ve looked at the numbers being plotted? $\endgroup$
    – Dave
    Commented Aug 24, 2023 at 17:38

1 Answer 1

3
$\begingroup$

The Precision is likely tanking because when we use a very high threshold, we end up with no True Positives, even though we might have some False Positives (i.e. negative examples we incorrectly assign a very high probability of being positive).

This drop is not too uncommon, it might signify mislabelling, edge cases or simply a slightly underfitted model. For starters, I would recommend plotting a calibration plot (e.g. see for example here for a sklearn functionality) such that you can assess the coherence/monotonicity of your predicted scores. If it is problematic (e.g. saw-tooth shaped), work on getting a more well-calibrated classifier; Calibration: the Achilles heel of predictive analytics (2019) is a great resource if you want to read a bit more on this. In addition to that, do some explainability analysis on your classifier too. Check which features are the ones affecting predictions the most and then investigate if the mislabeled examples have extreme values, this can highlight mislabeling or edge cases that might otherwise perplex us. A nice accessible blog post on this is "Machine learning interpretability with feature attribution". A real-life example of this would be the following: we identify that being older, male and overweight are significant risk factors for a particular symptom $C$ based on our model $M$, but the handful of morbidly obese older male patients in our test sample, do not have the symptom $C$. Our model's precision for a very high threshold will be likely $0$ despite $M$ being a potentially reasonable model overall.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

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