L1_test & L2_test - function not defined?

Hey everyone!

I am currently on the first assignment in the second week of this course. I may be missing something but there seems to be undefined methods called in the unchangeable portion of the L1 and L2 sections: L1_test and L2_test.

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)

####

yhat = np.array([.9, 0.2, 0.1, .4, .9])
y = np.array([1, 0, 0, 1, 1])

print("L2 = " + str(L2(yhat, y)))

L2_test(L2)

Even after writing L1 and L2 successfully, this throws errors. Does anyone know what the cause of this is?

1 Like

Hi @jeffreywang I see that L1_test and L2_test are defined in the public_tests.py file. Maybe you have not run the code cell where the statement from public_tests import * is present?

2 Likes