In the 5- Compute Cost section, I think I define the compute_cost in a right way but in the test part. It say there is an error : Cost must be 0 for a perfect prediction but…

I don’t know why the cost should be 0. I thought it would never be zero cuz we haven’t apply for the gradient descent on this.

For a perfect prediction, f_wb and y will be Eual. So the error is zero, and that means the cost is zero.

The test cases include one where the predictions are correct, to test if your compute_cost code works correctly.

I am facing the same problem and since 24 hours I am trying to fix but I failed to do so. if you have solved it could you guide me with the solution

1 Like

Hi @Iftikhar_Ahmad_Sheik, if you are still having difficulties finding a solution, please feel free to send me your code in private so that I can assist you.


1 Like

Hello, @Enzo_Faliveni_Alzuet

I am facing the same error. Can you please guide me

I am attaching the screenshot for your reference

There are two problems here:

  • This thread has been cold for a year.
  • Your post is a duplicate - you posted the same message in a new thread.

I’ll close this on.