Week 2 Python Basics with Numpy Exercise 8

What’s wrong with my code?

{moderator edit - solution code removed}

yhat = np.array([.9, 0.2, 0.1, .4, .9])
y = np.array([1, 0, 0, 1, 1])
print("L1 = " + str(L1(yhat, y)))

L1_test(L1)

L1 = 0.22000000000000003
Error: Wrong output
1 Tests passed
1 Tests failed

Please check the definition of the function that is given in the instructions. Later in these courses, the loss will be defined as the average over the samples, but notice that they do not mention that here.

Thanks!