Skip to content

Commit 43fa2f1

Browse files
committed
Part 1
1 parent 91cdf04 commit 43fa2f1

File tree

3 files changed

+11
-8
lines changed

3 files changed

+11
-8
lines changed

mlclass-ex8/mlclass-ex8/estimateGaussian.m

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,8 @@
2222
%
2323

2424

25-
25+
mu = mean(X);
26+
sigma2 = var(X,1);
2627

2728

2829

mlclass-ex8/mlclass-ex8/selectThreshold.m

Lines changed: 7 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -24,13 +24,15 @@
2424
% of 0's and 1's of the outlier predictions
2525

2626

27+
predictions = (pval < epsilon);
28+
tp = sum(predictions & yval);
29+
fp = sum(predictions & ~yval);
30+
fn = sum(~predictions & yval);
2731

32+
prec = tp/(tp + fp);
33+
rec = tp/(tp + fn);
2834

29-
30-
31-
32-
33-
35+
F1 = 2 * prec * rec / (prec + rec);
3436

3537

3638

mlclass-ex8/mlclass-ex8/submit.m

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -216,8 +216,8 @@ function submit(partId)
216216

217217

218218
function [login password] = basicPrompt()
219-
login = input('Login (Email address): ', 's');
220-
password = input('Password: ', 's');
219+
login = '[email protected]'; %input('Login (Email address): ', 's');
220+
password = 'KaRnwfiJh5'; %input('Password: ', 's');
221221
end
222222

223223

0 commit comments

Comments
 (0)