Hi,
I have an issue for the C3_W2_Collaborative_RecSys_Assignment
Exercise 1
In the steps it is asked to compute cofi_cost_func with and without regularization
In the function towards the end, where J is computed,
As it asks to compute J without regularization first followed by with regularization, and since it is the same function call,
I added like this
if(lambda_ == 0):
J +=
else :
J +=
Is this approach correct?
I dont get any syntax error, but the value of J that is returned WITH regularization is wrong.
But then I am getting error for the previous one where we calculate WITHOUT regularization where the expected output is 13.67 which I got with the different formula?
I guess there are two different formulas for with and without.
Is that not correct?
The part labeled B is the regularized portion of the cost.
If the cost function is called with the lambda parameter set to 0, then the B portion will compute to 0, so the function returns only the unregularized cost.
If you don’t get the correct results for the A portion, there is an error in your code.
I am kind of little lost.
From the “hints” portion of the exercise, it showed two different equations for w/o regularization and with regularization.
As per your tip, I should still use the equation for “regularization” and since lambda will be 0, it should work for w/o regularization also?
I am not sure if I am getting the correct value after following the equation.
I am stuck at this place.
I am aware that I am not supposed to paste the code here, but please delete it after I get the fix for this.
Please let me know what I did below is correct?
{mentor edit: code removed}
With regularization, I am getting a value of 302.13, while expected is 28.09