Please post an image that shows the syntax error message.
Please do not post your code on the forum. That’s not allowed by the Code of Conduct. If a mentor needs to see your code, we’ll contact you with instructions.
You can refer hints section below this grader cell
You can then, for example, compute the number of false positives using: fp = sum((predictions == 1) & (y_val == 0)).
Also you do not need to calculate tn for this
Oh, I see you did refer hints when you wrote the below code but you do not require the below codes
if F1 > best_F1:
best_F1 = F1
best_epsilon = epsilon
as it already recalled before the ##START CODE HERE
Also as said by Tom, kindly remove codes, don’t post on public thread.