AssertionError: Wrong output. Expected: 2.15510667 got: 2.75932426268233

Please help me find a solution. I got the error below:

AssertionError: Wrong output. Expected: 2.15510667 got: 2.75932426268233

It is on Class 1, Week 3 Practice Lab: Logistic_Regression. (The cell is right above “2.5 Gradient for logistic regression”). See the attached screen shot for more details. Thanks!

@Teofilo_Percy_Landa Can you recheck the loss computation for a single training example in the loop?

Hey @Teofilo_Percy_Landa,
And if you are unable to find the error, please DM your notebook as an attachment to me. For downloading your notebook, follow the Method-1 in this thread.

Cheers,
Elemento

I have the same error…did you find an answer?

Hello @Mahmoud_Mostafa_Ahme,

You can share your notebook with me and we’ll identify the issue.

I did this whole question again and was able to resolve the issue. Thank you for following up.

I this the exercise again following the guidelines in “Click for hints”. I was able to resolve the issue by doing it again. Sharing the notebook with the mentor is another way to resolve the error.

I’m having this exact issue too - need help to move forward…

Hey @John6,
Welcome to the community. Can you please DM your notebook to me as an attachment? Please follow the instructions listed under Method-1 on this thread to download your notebook.

P.S. - Posting code publicly is against the community guidelines, so, please refrain from doing so.

Cheers,
Elemento

I thought I was direct messaging, and not posting publicly. Sorry to bother

Hey @John6,
Have you DM your notebook to me, since I haven’t received any DM from you yet? Is it possible that you DM’d your notebook to someone else?

Cheers,
Elemento

don’t use lambda, i had the same error. its without regularization.

Hey @Asuri,
I am glad you were able to determine the solution on your own. I am assuming you are not talking about the fifth exercise, i.e., compute_cost_reg, because if you are, in that function, you are supposed to use lambda_, after all it’s a key part of regularization. If you have solved your problem by removing lambda_, then, the issue lies somewhere else, and by chance, removing lambda_ seems to be helping you.

Additionally, in the code that you DM’d to me, you are again implementing the cost without regularization. For that, you can simply call the previously implemented compute_cost function. I hope this helps.

Cheers,
Elemento

I have the same error and I Downloaded my Notebook and Refreshed my Workspace and it is still not working. What can I do? Thanks

Hello @Victoria_Riese ,
Welcome to the community. Could you share your notebook as an attachment in a DM?

Thanks!! SOLVED!
I was regularizing and it is not need at this part of the exercise

I have the same problem
how did you solve it?

Hi @Hamza_Amri, welcome to the community!

It looks like @Victoria_Riese’s post already explains what she needed to fix in her case. She wrote:

I was regularizing and it is not need at this part of the exercise