Collabrative filtering lab regularisation

In the lab the equation given is

However, the code to implement regularization is

Why do we not need to multiply x(i) regularization by lambda?

Does this mean the equation in the lab needs to be updated?

And also in the slides.

I had to check the hints to realise that the multiplication by lambda is not included, and that is why my tests were failing

I’ll check on it.

Can you give a specific reference to the lab name and section of the lab, and also where it appears in the slides?



  • Name: C3_W2_Collaborative_RecSys_Assignment
  • Section: 4.1
  • Exercise: 1


  • Week 2: Collaborative filtering algorithm lecture (link)
  • Timestamp: 8:49

I’ll check on the notebook.

Note that the lecture slides are never maintained. At most they can put a pop-up between video lectures to clarify specific points.

That makes sense, but if you do not apply the regularization to X then the code will return incorrect cost even with lambda = 0 . The hint for regularization is incorrect / not aligned to the regularization term on the slide. Took me a while to figure out as well.

Hey @Balazs_Margl, and @Osama_Bsher,

I just read very carefully the parentheses in that last hint for regularization, it does implement as the equation requires. Lambda is being multiplied to both the w term and the x term. :wink: Would you mind to take a second look?


1 Like

I see, my mistake!