Week 3 - Exercise 5 - compute_cost

An error in the 3rd decimal place is not a rounding error. You have just used the sample code that they gave you. That is not a complete solution, which they actually told you in the instructions although perhaps their wording was a bit too subtle.

Compare your implementation to the mathematical formula for the cost shown in the instructions (equation 13) and ask yourself two questions:

  1. What happened to the factor of 1/m?

  2. Why is there only one term? What happened to the Y = 0 term?

3 Likes