C3_W2_Collaborative_RecSys_Assignment- wrong value for regularized implementation

Hi,
I’m stuck here for a long time. Could someone help me to understand the problem? the output is right for ‘without regularization’. but the output is not correct for ‘with reglarization’.

This is the code i have given:

{mentor edit: code removed}

But i get the following error.

I wonder if someone could tell me where I could be wrong?

Check that you implemented the math correctly.

1 Like

Also, please don’t post your code on the forum. That’s not allowed by the Code of Conduct.

1 Like

Thank you so much! i didnt really think about it!

Hi, I also have the same problem, been trying to fix it for a few hours but it issue still exists.
I need help in this regard.

@haiderAI, what issue are you having specifically?

A screen capture image would be most useful (not of your code, but of any error messages you’re seeing).

TMosh, I am having same issue with the regularization term. I get an assertion error:

I’ve checked my math and used the hints by still getting the assertion error. Syntax and spacing look correct.

Please advise

The most common reason for this error is using a for-loop to compute J and using incorrect code for the regularized portion of J.