Exercise

Precision vs. recall

The accuracy metrics you use to evaluate your model should always be based on the specific application. For this example, let's assume you are a really sore loser when it comes to playing Tic-Tac-Toe, but only when you are certain that you are going to win.

Choose the most appropriate accuracy metric, either precision or recall, to complete this example. But remember, if you think you are going to win, you better win!

Use rfc, which is a random forest classification model built on the tic_tac_toe dataset.

Instructions

100 XP
  • Import the precision or the recall metric for sklearn. Only one method is correct for the given context.
  • Calculate the precision or recall using y_test for the true values and test_predictions for the predictions.
  • Print the final score based on your selected metric.