Skip to content

Conversation

@comeonsunny
Copy link

% ====================== YOUR CODE HERE ======================
% Instructions: Compute the cost of a particular choice of theta
% You should set J to the cost.
sum = 0;
temp_cost = X * theta - y;
for i = 1:m
sum = sum + temp_cost(i)^2;
end

J = (1/(2*m))*sum;

% ====================== YOUR CODE HERE ======================
% Instructions: Compute the cost of a particular choice of theta
%               You should set J to the cost.
sum = 0;
temp_cost = X * theta - y;
for i = 1:m
    sum = sum + temp_cost(i)^2;
end

J = (1/(2*m))*sum;
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant