Programming Assignment: Week 3 practice lab: logistic regression

The most common issue here is indentation. It’s particularly tricky with the nested for-loops that you’re asked to use.

The “Click for hints” and “Click for more hints” links essentially give you all the code - but it’s still easy to get the indentation wrong.

1 Like

AssertionError Traceback (most recent call last)
—> 10 compute_cost_test(compute_cost)

~/work/ in compute_cost_test(target)
24 b = 0
25 result = target(X, y, w, b)
—> 26 assert np.isclose(result, 2.15510667), f"Wrong output. Expected: {2.15510667} got: {result}"
28 X = np.random.randn(4, 3)

AssertionError: Wrong output. Expected: 2.15510667 got: 1.597429473694739

Error message refers to lines of code outside the START CODE and END CODE area where I’m expected to make any modifications. And this practice lab is taking so long.
How can I move forward?

The error message is being thrown by code that is testing the return value from your compute_cost() function.

Check your personal messages for instructions.