Week 3 practice lab: logistic regression. What does this code mean?

Hello Bastian,

For the same confusion, I had sent you the links which if you had read in detail would have got the code.

You do need follow the template code given in assignment book as the grader wants you to follow the same code lines to crack or write the correct code accordingly in the way they want.

z_wb is where you getting confused must be for
f_wb = sigmoid(z_wb) apply this code only in compute cost but

for compute gradient f_wb is calculated based on this image

Also there is no err_i code given in the template code, so please remove that code line. Follow the links I shared in the previous comment. People have got stuck in the same lines and I have explained how to go about.

  1. You need to write this section
    dj_db_i =
    dj_db +=

    for j in range(n):
        dj_dw[j] = 

based on these hints

Hope it helps!!!

Keep learning!!!


1 Like