Skip to content

Instantly share code, notes, and snippets.

@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week3-assignment-learning-parameters-using-fminunc.m
Last active March 4, 2020 01:51
Optimizing using fminunc to find the optimal parameters theta in ex2data1.txt.
% Octave console output
Cost at theta found by fminunc: 0.203498
theta:
-25.161272
0.206233
0.201470
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week3-assignment-predict-and-accuracies.m
Last active November 16, 2015 12:46
use the logistic regression model to predict the probability that a student with score 45 on exam 1 and score 85 on exam 2 will be admitted. (in ex2data2.txt)
% Octave console output
For a student with scores 45 and 85, we predict an admission probability of 0.776289
Train Accuracy: 89.000000
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week3-assignment-add-polynomial-features-and-compute-cost.m
Last active November 16, 2015 12:46
Add Polynomial Features And Compute Cost. (mapFeatured X: [X1 X2 (X1.^2) (X2.^2) (X1X2) (X1X2.^2) …])(in ex2data2.txt)
% Octave console output
Cost at initial theta (zeros): 0.693147
% Octave console output
Train Accuracy: 86.440678
% Octave console output
Train Accuracy: 83.050847
% Octave console output
Train Accuracy: 61.016949
% Octave console output
Training One-vs-All Logistic Regression...
Iteration 50 | Cost: 1.375603e-02 % k = 1
Iteration 50 | Cost: 5.725232e-02 % k = 2
Iteration 50 | Cost: 6.419917e-02 % k = 3
Iteration 50 | Cost: 3.576346e-02 % k = 4
Iteration 50 | Cost: 6.183236e-02 % k = 5
Iteration 50 | Cost: 2.121825e-02 % k = 6
Iteration 50 | Cost: 3.489292e-02 % k = 7
Iteration 50 | Cost: 8.559999e-02 % k = 8
% Octave console output
Training Set Accuracy: 95.020000
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week4-feedforward-propagation-and-prediction.m
Created November 16, 2015 14:13
Feedforward Propagation and Prediction (Loading Saved Neural Network Parameters in ex3weights.mat)
% Octave console output
Training Set Accuracy: 97.520000
@joyhuang9473
joyhuang9473 / coursera-stanford-machine-learning-class-week5-feedforward-using-neural-network-and-compute-cost.m
Last active November 16, 2015 15:42
Feedforward Using Neural Network and Compute Cost at parameters (loaded from ex4weights)
% Octave console output
Feedforward Using Neural Network ...
Cost at parameters (loaded from ex4weights): 0.287629
(this value should be about 0.287629)