Assertion Error - test_eval_mse(eval_mse)

I defined a simple function def(eval_mse) and i am getting this error after running the code below:

{removed code by mentor}

y_hat = np.array([2.4, 4.2])
y_tmp = np.array([2.3, 4.1])
eval_mse(y_hat, y_tmp)

# BEGIN UNIT TEST
test_eval_mse(eval_mse)   
# END UNIT TEST
AssertionError                            Traceback (most recent call last)
<ipython-input-56-eb47829dd554> in <module>
      4 
      5 # BEGIN UNIT TEST
----> 6 test_eval_mse(eval_mse)
      7 # END UNIT TEST

~/work/public_tests_a1.py in test_eval_mse(target)
     13     result = target(y_hat, y_tmp)
     14 
---> 15     assert np.isclose(result, 0.005, atol=1e-6), f"Wrong value. Expected 0.005, got {result}"
     16 
     17     y_hat = np.array([3.] * 10)

AssertionError: Wrong value. Expected 0.005, got 0.0

Hello @murat_kahraman!

You have used y_hat instead of yhat :wink:

yhat is the variable provided in the arguments of the function eval_mse, so if you don’t use it, the function won’t use the input provided by the tests (and later calls of the function) for computing the results that the tests are expecting for.

Be careful about the variable names :wink:

Raymond

PS: Sharing assignment code in the community is against the guideline, so I am going to remove it for you.

Thank you so much for your help and for pointing out my error. I missed the yhat and y_hat. :grinning: I really appreciate your guidance and support.