2
$\begingroup$

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?

$\endgroup$
3
$\begingroup$
  • 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).
$\endgroup$
  • $\begingroup$ Could you please provide some example code for weighted loss implementation in Keras or TF? $\endgroup$ – Avis Feb 20 '18 at 7:22
  • $\begingroup$ @Avis in Keras you can use loss_weights argument model.compile. $\endgroup$ – Jakub Bartczuk Feb 20 '18 at 8:50

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.