Commits

Dhananjay Nene committed 39bbd64

Solved part 3 of exercise 8 (cost function computation for recommender systems)

  • Participants
  • Parent commits 52f0bb5

Comments (0)

Files changed (1)

File exercise-8/octave/cofiCostFunc.m

 X = reshape(params(1:num_movies*num_features), num_movies, num_features);
 Theta = reshape(params(num_movies*num_features+1:end), ...
                 num_users, num_features);
-
             
 % You need to return the following values correctly
 J = 0;
 %                     partial derivatives w.r.t. to each element of Theta
 %
 
-
+J = sum(sum(((X * Theta' - Y) .^2) .* R /2))