Get startedGet started for free

Precision or Recall, that is the question

You learned about a few performance metrics and maybe you are asking, when should I use precision and when should I use recall? Those two metrics are calculated for each class, and sometimes it is difficult to understand when to focus on one and when to focus on the other.

Precision is a metric that measures how well the model is predicting some class, while recall measures how well a class is being classified. If precision is high for one class, you can trust your model when it predicts that class. When recall is high for a class, you can rest assured that that class is well understood by the model.

Follow the instruction to see this comparison between precision and recall with an example. The functions precision_score() and recall_score() are loaded.

This exercise is part of the course

Recurrent Neural Networks (RNNs) for Language Modeling with Keras

View Course

Hands-on interactive exercise

Have a go at this exercise by completing this sample code.

# Compute the precision of the sentiment model
prec_sentiment = ____(sentiment_y_true, ____, average=None)
____
Edit and Run Code