Please do not share your code on the forum. That’s not allowed by the Code of Conduct. Posting your error messages is a better method. If a mentor needs to see your code, we’ll contact you with instructions.
Hint: Does your code ever update the value in cost_sum?
What exactly do you mean by “navigating the datasets”? I don’t think any navigation is necessary.
If you follow along in the instructions in the notebook, and come to something you don’t understand or doesn’t work, please post a screen capture image of the issue.
Note that you should not post an image of your code.
i am running the same code as the optional lab for week 3 excercise 3 and getting this error File “”, line 24
err_i = f_wb_i - y[i]
^
SyntaxError: invalid syntax.
If you’re working on the Week 2 graded assignment (as your thread title indicates), you should not be using code that includes sigmoid().
The syntax error may be due to copy-and-paste that includes some non-printable character. Try deleting the indentation from that line, and re-insert it.
Hi I’m getting this error. It seems that I’m just getting a different answer than expected, but I don’t see anything obviously wrong with my code. Thanks for the help.
AssertionError Traceback (most recent call last)
in
9 # Public tests
10 from public_tests import *
—> 11 compute_cost_test(compute_cost)
~/work/public_tests.py in compute_cost_test(target)
17 initial_b = 1.0
18 cost = target(x, y, initial_w, initial_b)
—> 19 assert cost == 2, f"Case 2: Cost must be 2 but got {cost}"
20
21 # print(“Using X with shape (5, 1)”)
AssertionError: Case 2: Cost must be 2 but got 1.5