diff --git a/mlclass-ex1/computeCostMulti.m b/mlclass-ex1/computeCostMulti.m index d9a3d68..bec72e1 100644 --- a/mlclass-ex1/computeCostMulti.m +++ b/mlclass-ex1/computeCostMulti.m @@ -14,7 +14,7 @@ % You should set J to the cost. - +J = sum((X*theta - y).^2)/(2*m); % ========================================================================= diff --git a/mlclass-ex1/normalEqn.m b/mlclass-ex1/normalEqn.m index d32cd8e..2c8c74a 100644 --- a/mlclass-ex1/normalEqn.m +++ b/mlclass-ex1/normalEqn.m @@ -12,7 +12,7 @@ % ---------------------- Sample Solution ---------------------- - +theta = pinv(X'*X)*(X'*y); % -------------------------------------------------------------