###### Coursera机器学习 week7 assignment

gaussianKernel.m:

sim = exp(- sum((x1-x2).^2) / (2*(sigma^2)) );

dataset3Params.m:

lambda_all = [0.01 0.03 0.1 0.3 1 3 10 30]';
len_all = size(lambda_all, 1);
error_matrix = zeros(len_all, len_all);

for i = 1:len_all
now_C = lambda_all(i);
for j = 1:len_all
now_sigma = lambda_all(j);
model = svmTrain(X, y, now_C, @(x1, x2) gaussianKernel(x1, x2, now_sigma));
predictions = svmPredict(model, Xval);
error = mean(double(predictions ~= yval));

error_matrix(i, j) = error;
end
end

ans_min = min(error_matrix(:));  %找出（8*8）中的最小值
[index_C, index_sigma] = find(error_matrix==ans_min);  %找出该最小值在（8*8）中的行、列索引

C = lambda_all(index_C);
sigma = lambda_all(index_sigma);

processEmail.m:

for i = 1:length(vocabList)
if(strcmp(str, vocabList{i}) == 1)
word_indices = [word_indices ; i];
break;
else
continue;
end
end

emailFeatures.m:

for i = 1:length(word_indices)
x(word_indices(i)) = 1;
end

#### Machine Learning week 7 quiz: programming assignment-Support Vector Machines

2015-11-27 11:17:23

#### 【Coursera】Machine learning - week7 : Support Vector Machines

2016-04-01 21:02:54

#### Machine Learning(Andrew)Week7(下)

2014-05-09 13:24:37

#### [Coursera机器学习]Support Vector Machines WEEK7编程作业

2016-12-10 21:40:58

#### 20170123 Coursera Stanford-MachineLearning/Week7

2017-01-23 17:22:11

#### Coursera机器学习 Week7 笔记

2017-08-22 20:14:05

#### Coursera Machine Learning 第一周 quiz Linear Algebra习题答案

2016-11-09 00:08:30

#### Coursera Machine Learning quiz 参考答案（不一定对）

2017-08-17 10:39:05

#### Coursera Machine Learning 第三周 quiz Logistic Regression

2016-11-10 15:26:57

#### Coursera Machine Learning 第六周 quiz Machine Learning System Design

2016-11-12 15:59:14

## 不良信息举报

Coursera机器学习 week7 assignment