C3_W1_Lab 2_Assignment - Exercise 2

For the select_threshold function, how does the for loop iterate over each epsilon? If any value of F1 not equal to 0 is received, doesn’t the loop stop and return that best_epsilon and best_F1? If F1 > 0, why does the for loop continue?

F1 is a score, the higher the score, the better it is. F1 = 0.9 is better than F1 = 0.5, why should it stop at 0.5?

Arriving at these lines,

    if F1 > best_F1: 
        best_F1 = F1
        best_epsilon = epsilon

How does the loop know it has to go on to the next value of epsilon?

It always go to the next value. There is no code that can stop the for loop.

These lines serve to record the F1 and the corresponding epsilon when a better pair of them shows up.

Oh I understand it now…Thank you!

No problem @rshwati_s