Hello,
I received the following response after attempting to submit MLS W3 final assignment:
“Cell #14. Can’t compile the student’s code. Error: NameError(“name ‘z_wb’ is not defined”)”. I previously had an error message that included ‘z_wb’, which I seems to be solved now, but I’m still getting the same Cell #14 error message when I submit my assignment.
Separately, I have assertion errors. Based on the threads, it seems that it relates to indentation, three error message appears in the subsequent boxes after my coding.
Please can you advise?
Thank you
_C3
AssertionError Traceback (most recent call last)
in
8
9 # UNIT TESTS
—> 10 compute_gradient_test(compute_gradient)
~/work/public_tests.py in compute_gradient_test(target)
51 dj_db, dj_dw = target(X, y, test_w, test_b)
52
—> 53 assert np.isclose(dj_db, 0.28936094), f"Wrong value for dj_db. Expected: {0.28936094} got: {dj_db}"
54 assert dj_dw.shape == test_w.shape, f"Wrong shape for dj_dw. Expected: {test_w.shape} got: {dj_dw.shape}"
55 assert np.allclose(dj_dw, [-0.11999166, 0.41498775, -0.71968405]), f"Wrong values for dj_dw. Got: {dj_dw}"
AssertionError: Wrong value for dj_db. Expected: 0.28936094 got: 0.0014534636631983945
_C4
AssertionError Traceback (most recent call last)
in
9
10 # UNIT TESTS
—> 11 predict_test(predict)
~/work/public_tests.py in predict_test(target)
69 raise ValueError(“Did you apply the sigmoid before applying the threshold?”)
70 assert result.shape == (len(X),), f"Wrong length. Expected : {(len(X),)} got: {result.shape}"
—> 71 assert np.allclose(result, expected_1), f"Wrong output: Expected : {expected_1} got: {result}"
72
73 b = -1.7
AssertionError: Wrong output: Expected : [1.0, 1.0, 1.0, 0.0, 1.0, 0.0, 0.0, 1.0] got: [1. 1. 1. 1. 1. 1. 1. 1.]
_C6
AssertionError Traceback (most recent call last)
in
11
12 # UNIT TESTS
—> 13 compute_gradient_reg_test(compute_gradient_reg)
~/work/public_tests.py in compute_gradient_reg_test(target)
122 dj_db, dj_dw = target(X, y, w, b, lambda_)
123
→ 124 assert np.isclose(dj_db, expected1[0]), f"Wrong dj_db. Expected: {expected1[0]} got: {dj_db}"
125 assert np.allclose(dj_dw, expected1[1]), f"Wrong dj_dw. Expected: {expected1[1]} got: {dj_dw}"
126
AssertionError: Wrong dj_db. Expected: -0.1506447567869257 got: -0.07142857142857142