MLS Course 1 week 2 assignment

I am getting this error
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 5.0

what is the issue.

Hi @hudhaifagburi

Here is a post written by one of our mentors on debugging. It is very comprehensive list with various problems that you might be encountered. I hope you might find it helpful.

1 Like

The compute cost function is not correct. In the error message said that you got a value that doesn’t correspond with what was expected.

1 Like