Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Select an option

  • Save joyhuang9473/70ff08a77597f684988c to your computer and use it in GitHub Desktop.

Select an option

Save joyhuang9473/70ff08a77597f684988c to your computer and use it in GitHub Desktop.
In ex1data2.txt, console outputs of predicted price with Octave
% error output
% ============
Normalizing Features ...
Running gradient descent ...
Theta computed from gradient descent:
334425.499894
100131.267805
3639.767537
Predicted price of a 1650 sq-ft, 3 br house (using gradient descent):
$165561936.680953
Program paused. Press enter to continue.
Solving with normal equations...
theta =
8.9598e+04
1.3921e+02
-8.7380e+03
Theta computed from the normal equations:
89597.909542
139.210674
-8738.019112
Predicted price of a 1650 sq-ft, 3 br house (using normal equations):
$293081.464335
% ============
% correct output
% ============
Normalizing Features ...
Running gradient descent ...
Theta computed from gradient descent:
334425.499894
100131.267805
3639.767537
Predicted price of a 1650 sq-ft, 3 br house (using gradient descent):
$281289.540773
Program paused. Press enter to continue.
Solving with normal equations...
theta =
8.9598e+04
1.3921e+02
-8.7380e+03
Theta computed from the normal equations:
89597.909542
139.210674
-8738.019112
Predicted price of a 1650 sq-ft, 3 br house (using normal equations):
$293081.464335
% ============
@DarkT2014
Copy link
Copy Markdown

hello, could u pls tell me how to normalize features correctly? I have the same wrong answer, but I still dont know how to write a correct script after reading your code. Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment