Week #3: Assertion Error in the test code for UNQ_C3 in C1_W3_Logistic_Regression Practice Lab

When creating a post, please add:

  • Week #3 C1_W3_Logistic_Regression Practice Lab
  • Description: I encounter an assertion error when I run the test code for UNQ_C3, the exercise for creating the gradient descent function. I am getting wrong value for dj_dw but correct one for dj_db

The error is telling you exactly what is wrong!

The code for dj_dw is incorrect. You should go back and double check to make sure you wrote the code correctly for that formula.

I am getting a somewhat similar error as the one above. Difference is my error dj_db is incorrect. The output that I am getting ( top 2 lines ) is the same as the Expected Output ( bottom 2 lines) barring the last 4 digits, per the screenshot below.

I re-checked the fomula for dj_db and can’t see the reason for my dj_db to be off by 0.03. Any suggestions ?

Are you running the lab on the Coursera website or did you download it to your computer?

Unfortunately, I can’t tell what the problem is just from that screenshot. It’s very likely that there was a mistake with the equation for dj_db.