Linear regressing using the normal equation
This commit is contained in:
parent
ad9ab582de
commit
ba377e29ba
1 changed files with 3 additions and 8 deletions
|
@ -10,12 +10,7 @@ theta = zeros(size(X, 2), 1);
|
||||||
% to linear regression and put the result in theta.
|
% to linear regression and put the result in theta.
|
||||||
%
|
%
|
||||||
|
|
||||||
% ---------------------- Sample Solution ----------------------
|
theta = pinv(X' * X) * X' * y;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
% -------------------------------------------------------------
|
|
||||||
|
|
||||||
|
|
||||||
% ============================================================
|
% ============================================================
|
||||||
|
|
Reference in a new issue