There's always a tradeoff between precision and recall. I'm dealing with a multi-class problem, where for some classes I have perfect precision but really low recall.

Since for my problem false positives are less of an issue than missing true positives, I want reduce precision in favor of increasing recall for some specific classes, while keeping other things as stable as possible. What are some ways to trade in precision for better recall?


1 Answer 1

  • Weighted loss (ML software like scikit-learn or Keras let you attach weights to classes, so that you can tell which is more significant)
  • Oversampling the low recall classes/undersampling other classes (you should especially check out this method if you have unbalanced classes).
  • $\begingroup$ Could you please provide some example code for weighted loss implementation in Keras or TF? $\endgroup$
    – Avis
    Commented Feb 20, 2018 at 7:22
  • $\begingroup$ @Avis in Keras you can use loss_weights argument model.compile. $\endgroup$ Commented Feb 20, 2018 at 8:50

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.