First question

This commit is contained in:
julien Lengrand-Lambert
2015-12-20 11:35:08 +01:00
parent 8c6997b185
commit d06f528065
3 changed files with 8 additions and 6 deletions

View File

@@ -35,7 +35,7 @@ load('ex6data1.mat');
plotData(X, y);
fprintf('Program paused. Press enter to continue.\n');
pause;
% pause;
%% ==================== Part 2: Training Linear SVM ====================
% The following code will train a linear SVM on the dataset and plot the
@@ -55,7 +55,7 @@ model = svmTrain(X, y, C, @linearKernel, 1e-3, 20);
visualizeBoundaryLinear(X, y, model);
fprintf('Program paused. Press enter to continue.\n');
pause;
% pause;
%% =============== Part 3: Implementing Gaussian Kernel ===============
% You will now implement the Gaussian kernel to use
@@ -70,7 +70,7 @@ fprintf(['Gaussian Kernel between x1 = [1; 2; 1], x2 = [0; 4; -1], sigma = 0.5 :
'\n\t%f\n(this value should be about 0.324652)\n'], sim);
fprintf('Program paused. Press enter to continue.\n');
pause;
% pause;
%% =============== Part 4: Visualizing Dataset 2 ================
% The following code will load the next dataset into your environment and
@@ -87,7 +87,7 @@ load('ex6data2.mat');
plotData(X, y);
fprintf('Program paused. Press enter to continue.\n');
pause;
% pause;
%% ========== Part 5: Training SVM with RBF Kernel (Dataset 2) ==========
% After you have implemented the kernel, we can now use it to train the

View File

@@ -16,10 +16,12 @@ sim = 0;
%
%
xt = (x1 - x2).^2;
top = sum(xt);
bottom = 2 * (sigma^2);
sim = exp(-top/bottom);
% =============================================================

Binary file not shown.