Anonaly Detection Lab 2: Choosing threshold

In Lab 2, of week 1, after completing select_threshold function and running next cells, I am getting an error because for the final value of epsilon the true positive = 0 which makes both precision and recall 0. This ultimately makes F1 score indeterminate 0/0. How can I fix it?

Here’s the code.

{moderator edit: code removed}

Do you still need help with this assignment? I have removed the code from your post, because that isn’t allowed by the Code of Conduct.