Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hackassin
GitHub Repository: hackassin/Coursera-Machine-Learning
Path: blob/master/Week 7/Programming Assignment - 6/ex6/submit.m
863 views
1
function submit()
2
addpath('./lib');
3
4
conf.assignmentSlug = 'support-vector-machines';
5
conf.itemName = 'Support Vector Machines';
6
conf.partArrays = { ...
7
{ ...
8
'1', ...
9
{ 'gaussianKernel.m' }, ...
10
'Gaussian Kernel', ...
11
}, ...
12
{ ...
13
'2', ...
14
{ 'dataset3Params.m' }, ...
15
'Parameters (C, sigma) for Dataset 3', ...
16
}, ...
17
{ ...
18
'3', ...
19
{ 'processEmail.m' }, ...
20
'Email Preprocessing', ...
21
}, ...
22
{ ...
23
'4', ...
24
{ 'emailFeatures.m' }, ...
25
'Email Feature Extraction', ...
26
}, ...
27
};
28
conf.output = @output;
29
30
submitWithConfiguration(conf);
31
end
32
33
function out = output(partId, auxstring)
34
% Random Test Cases
35
x1 = sin(1:10)';
36
x2 = cos(1:10)';
37
ec = 'the quick brown fox jumped over the lazy dog';
38
wi = 1 + abs(round(x1 * 1863));
39
wi = [wi ; wi];
40
if partId == '1'
41
sim = gaussianKernel(x1, x2, 2);
42
out = sprintf('%0.5f ', sim);
43
elseif partId == '2'
44
load('ex6data3.mat');
45
[C, sigma] = dataset3Params(X, y, Xval, yval);
46
out = sprintf('%0.5f ', C);
47
out = [out sprintf('%0.5f ', sigma)];
48
elseif partId == '3'
49
word_indices = processEmail(ec);
50
out = sprintf('%d ', word_indices);
51
elseif partId == '4'
52
x = emailFeatures(wi);
53
out = sprintf('%d ', x);
54
end
55
end
56
57