Possible bug in C1M2 Recall calculation

In the ungraded lab on Retrieval metrics , the following code is used to calculate recall :

false_negatives = sum(
newsgroups_train.target_names[df.iloc[idx][“category”]] == desired_category
for idx in top_results
) - true_positives

This appears to be incorrect because it looks over the indices within the top_results . Now the entries matching category in top_results are basically true positives , so this subtraction would just give you 0 . Thats why the Recall value is always 100%

Please fix

1 Like

As you put it I think you might a point here, but I am not sure of the contents for this course!