Assertionerror in course 1 MLS week 2 assignment

Hello all
I ran my code and got the error massage below.
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 32.0
I solicit your assistance please

This means your compute_cost() function doesn’t return the correct value.
There is an error in your code.
Check that your code implements the cost equation correctly.

Thank you.

Let me check again

Thanks to all of you my mentors.

I

Thanks to all of you my mentors @TMosh, @gent.spah. I have passed the two assignments.
I am glad

1 Like