C3_W2_Collaborative_RecSys_Assignment - Regularization Term

I am stuck on the public test part of Exercise 1. In Exercise 1, I applied the non-regularized implementation of J inside the loop, and regularized it by multiplying the above by (lambda/2). However, while result for Evaluation of the cost function with regularization is incorrect, leading to an error on the public tests. Can someone please assist? The error I am getting is:

Wrong value. Expected 27, got 0.0. Check the regularization term

I’m not sure which part of the assignment you ar discussing, where you got the “Expected 27” message.

Can you post a screen capture image that shows which test you are running, and your results?

(Note: Do not post your code, just the cell that runs the test and your results).

This is where I see this error

So your code did not return the correct cost in either test case that had a non-zero value for lambda.

In the 1st test, you have 23.92 instead of 28.09
In the 2nd test, you have 0.0 instead of 27.0

Do your tests where lambda = 0 give the correct results?

For debugging, start by inspecting your code for cofi_cost_func(), and be sure you’re using the correct variables, and that they are spelled correctly (including upper- vs lower-case letters).

Then, inspect that the code you added to cofi_cost_func() is using the same local variable names from the function parameter list - and that you are not using any global variable names from the notebook’s scope.

Yes, I get the correct answer where lambda = 0. Can I message you my code privately?

I am unable to figure out what is wrong with my code

Please check your personal messages for instructions.