Anomaly detection assiment

# UNQ_C2
# GRADED FUNCTION: select_threshold

def select_threshold(y_val, p_val): 

    # moderator edit: code removed        

    return best_epsilon, best_F1

assertionerror: Wrong best_epsilon. Expected: 0.04 got: 0
what’s wrong I tried for an hour to figure it out

1 Like

i also get a syntax error
i think the cell is wrong or something

1 Like

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

  1. You can then, for example, compute the number of false positives using:
    fp = sum((predictions == 1) & (y_val == 0)).

  2. Also you do not need to calculate tn for this

  3. 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.