W 3 EX 5 compute_cost_test wrong value problem

Hi, I’m trying to accomplish week 3 lab.

exercise 5 is pretty straightforward copy-paste task, what could be wrong…

(Solution code removed, as posting it publicly is against the honour code of this community, regardless if it is correct or not. You can share the errors you get)

but test shows that I missed something

final cost value is very close (0.001 diff), so all looking good, but inspection of test function shows 2 hardcoded values

and they’re completely off…

I understand that error must be from my side, since this exercise was finished thousands times by other students. But I spent nearly 3 hours without success :slight_smile:

same problem in ex 6, just slight difference in values, but probably huge in test case

Hi @Dmitry_Regent,

Sharing solution code publicly is prohibited in the community. I have removed it.

As for the code you shared, you took the expressions as it is and implemented them. Those were shown to you as an example and are not the complete equations. You have to add in the rest.

Below the 4.4 section is the complete equation. What we shared and you copy/pasted is only half of the equation.


Thanks for your help, Mubsi! works fine now