C1_W3_logistic regression local variable 'z_wb_ij' referenced before assignment

Hello,
I am doing exercise 3 of 2.5 Gradient for logistic regression and when I run my code, the following error message appears
local variable ‘z_wb_ij’ referenced before assignment
Could someone review my notebook and help out please ? @Girijesh maybe ? :slight_smile:
Thank you

1 Like

Dear @IreneVH,

Please send me your notebook to me. I’ll look into the issues.

1 Like

{moderator edit: code removed}

Dear @Girijesh ,
Please find enclosed my notebook.
Many thanks in advance for your help,
Good evening.

1 Like

I think I found the solution, I had to remove a + before the = to reference the variable
z_wb_ij = X[i,j]*w[j]
instead of
z_wb_ij += X[i,j]*w[j]
line 26.
However, I am now stuck with another problem at the next cell.
the selected output is wrong.
Please see enclosed.
Many thanks again
{moderator edit: code removed}

1 Like

Hi again, I found again the solution
for j in range(n):
dj_dw[j] =

I had forgotten the [j]

1 Like

Dear @IreneVH,

Please do not post/share code publicly on the community.

Send me personal message with all the lab files.

1 Like

Dear @Girijesh , sorry I thought that I was sending you a personal message and not a public one. I managed to find the solutions myself in the end and I finished the class, thank you so much for all your help, I wish you a wonderful day.

1 Like