亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? svmfenlei.m

?? 經典的支持向量機SVM用于分類的MATLAB程序,可用于辨識,分類和參數優化!
?? M
字號:
%%%%%%%%%%%%%%%%%%%%%%%
function demsvm1()
% DEMSVM1 - Demonstrate basic Support Vector Machine classification
% 
%   DEMSVM1 demonstrates the classification of a simple artificial data
%   set by a Support Vector Machine classifier, using different kernel
%   functions.
%
%   See also
%   SVM, SVMTRAIN, SVMFWD, SVMKERNEL, DEMSVM2
%
% 
% Copyright (c) Anton Schwaighofer (2001) 
% This program is released unter the GNU General Public License.
% 
X = [2 7; 3 6; 2 2; 8 1; 6 4; 4 8; 9 5; 9 9; 9 4; 6 9; 7 4];
Y = [ +1;  +1;  +1;  +1;  +1;  -1;  -1;  -1;  -1;  -1;  -1];
% define a simple artificial data set
x1ran = [0 10];
x2ran = [0 10];
% range for plotting the data set and the decision boundary
disp(' ');
disp('This demonstration illustrates the use of a Support Vector Machine');
disp('(SVM) for classification. The data is a set of 2D points, together');
disp('with target values (class labels) +1 or -1.');
disp(' ');
disp('The data set consists of the points');
ind = [1:length(Y)]';
fprintf('X%2i = (%2i, %2i) with label Y%2i = %2i\n', [ind, X, ind, Y]');
disp(' ')
disp('Press any key to plot the data set');
pause
f1 = figure;
plotdata(X, Y, x1ran, x2ran);
title('Data from class +1 (squares) and class -1 (crosses)');
fprintf('\n\n\n\n');
fprintf('The data is plotted in figure %i, where\n', f1);
disp('  squares stand for points with label Yi = +1');
disp('  crosses stand for points with label Yi = -1');
disp(' ')
disp(' ');
disp('Now we train a Support Vector Machine classifier on this data set.');
disp('We use the most simple kernel function, namely the inner product');
disp('of points Xi, Xj (linear kernel K(Xi,Xj) = Xi''*Xj )');
disp(' ');
disp('Press any key to start training')
pause
net = svm(size(X, 2), 'linear', [], 10);
net = svmtrain(net, X, Y);
f2 = figure;
plotboundary(net, x1ran, x2ran);
plotdata(X, Y, x1ran, x2ran);
plotsv(net, X, Y);
title(['SVM with linear kernel: decision boundary (black) plus Support' ...
       ' Vectors (red)']);
fprintf('\n\n\n\n');
fprintf('The resulting decision boundary is plotted in figure %i.\n', f2);
disp('The contour plotted in black separates class +1 from class -1');
disp('(this is the actual decision boundary)');
disp('The contour plotted in red are the points at distance +1 from the');
disp('decision boundary, the blue contour are the points at distance -1.');
disp(' ');
disp('All examples plotted in red are found to be Support Vectors.');
disp('Support Vectors are the examples at distance +1 or -1 from the ');
disp('decision boundary and all the examples that cannot be classified');
disp('correctly.');
disp(' ');
disp('The data set shown can be correctly classified using a linear');
disp('kernel. This can be seen from the coefficients alpha associated');
disp('with each example: The coefficients are');
ind = [1:length(Y)]';
fprintf('  Example %2i: alpha%2i = %5.2f\n', [ind, ind, net.alpha]');
disp('The upper bound C for the coefficients has been set to');
fprintf('C = %5.2f. None of the coefficients are at the bound,\n', ...
net.c(1));
disp('this means that all examples in the training set can be correctly');
disp('classified by the SVM.')
disp(' ');
disp('Press any key to continue')
pause
X = [X; [4 4]];
Y = [Y; -1];
net = svm(size(X, 2), 'linear', [], 10);
net = svmtrain(net, X, Y);
f3 = figure;
plotboundary(net, x1ran, x2ran);
plotdata(X, Y, x1ran, x2ran);
plotsv(net, X, Y);
title(['SVM with linear kernel: decision boundary (black) plus Support' ...
       ' Vectors (red)']);
fprintf('\n\n\n\n');
disp('Adding an additional point X12 with label -1 gives a data set');
disp('that can not be linearly separated. The SVM handles this case by');
disp('allowing training points to be misclassified.');
disp(' ');
disp('Training the SVM on this modified data set we see that the points');
disp('X5, X11 and X12 can not be correctly classified. The decision');
fprintf('boundary is shown in figure %i.\n', f3);
disp('The coefficients alpha associated with each example are');
ind = [1:length(Y)]';
fprintf('  Example %2i: alpha%2i = %5.2f\n', [ind, ind, net.alpha]');
disp('The coefficients of the misclassified points are at the upper');
disp('bound C.');
disp(' ')
disp('Press any key to continue')
pause

fprintf('\n\n\n\n');
disp('Adding the new point X12 has lead to a more difficult data set');
disp('that can no longer be separated by a simple linear kernel.');
disp('We can now switch to a more powerful kernel function, namely');
disp('the Radial Basis Function (RBF) kernel.');
disp(' ')
disp('The RBF kernel has an associated parameter, the kernel width.');
disp('We will now show the decision boundary obtained from a SVM with');
disp('RBF kernel for 3 different values of the kernel width.');
disp(' ');
disp('Press any key to continue')
pause
net = svm(size(X, 2), 'rbf', [8], 100);
net = svmtrain(net, X, Y);
f4 = figure;
plotboundary(net, x1ran, x2ran);
plotdata(X, Y, x1ran, x2ran);
plotsv(net, X, Y);
title(['SVM with RBF kernel, width 8: decision boundary (black)' ...
       ' plus Support Vectors (red)']); 
fprintf('\n\n\n\n');
fprintf('Figure %i shows the decision boundary obtained from a SVM\n', ...
f4);
disp('with Radial Basis Function kernel, the kernel width has been');
disp('set to 8.');
disp('The SVM now interprets the new point X12 as evidence for a');
disp('cluster of points from class -1, the SVM builds a small ''island''');
disp('around X12.');
disp(' ')
disp('Press any key to continue')
pause

net = svm(size(X, 2), 'rbf', [1], 100);
net = svmtrain(net, X, Y);
f5 = figure;
plotboundary(net, x1ran, x2ran);
plotdata(X, Y, x1ran, x2ran);
plotsv(net, X, Y);
title(['SVM with RBF kernel, width 1: decision boundary (black)' ...
       ' plus Support Vectors (red)']); 
fprintf('\n\n\n\n');
fprintf('Figure %i shows the decision boundary obtained from a SVM\n', ...
f5);
disp('with radial basis function kernel, kernel width 1.');
disp('The decision boundary is now highly shattered, since a smaller');
disp('kernel width allows the decision boundary to be more curved.');
disp(' ')
disp('Press any key to continue')
pause

net = svm(size(X, 2), 'rbf', [36], 100);
net = svmtrain(net, X, Y);
f6 = figure;
plotboundary(net, x1ran, x2ran);
plotdata(X, Y, x1ran, x2ran);
plotsv(net, X, Y);
title(['SVM with RBF kernel, width 36: decision boundary (black)' ...
       ' plus Support Vectors (red)']); 
fprintf('\n\n\n\n');
fprintf('Figure %i shows the decision boundary obtained from a SVM\n', ...
f6);
disp('with radial basis function kernel, kernel width 36.');
disp('This gives a decision boundary similar to the one shown in');
fprintf('Figure %i for the SVM with linear kernel.\n', f2);

fprintf('\n\n\n\n');
disp('Press any key to end the demo')
pause
delete(f1);
delete(f2);
delete(f3);
delete(f4);
delete(f5);
delete(f6);

function plotdata(X, Y, x1ran, x2ran)
% PLOTDATA - Plot 2D data set
% 
hold on;
ind = find(Y>0);
plot(X(ind,1), X(ind,2), 'ks');
ind = find(Y<0);
plot(X(ind,1), X(ind,2), 'kx');
text(X(:,1)+.2,X(:,2), int2str([1:length(Y)]'));
axis([x1ran x2ran]);
axis xy;

function plotsv(net, X, Y)
% PLOTSV - Plot Support Vectors
% 
hold on;
ind = find(Y(net.svind)>0);
plot(X(net.svind(ind),1),X(net.svind(ind),2),'rs');
ind = find(Y(net.svind)<0);
plot(X(net.svind(ind),1),X(net.svind(ind),2),'rx');

function [x11, x22, x1x2out] = plotboundary(net, x1ran, x2ran)
% PLOTBOUNDARY - Plot SVM decision boundary on range X1RAN and X2RAN
% 
hold on;
nbpoints = 100;
x1 = x1ran(1):(x1ran(2)-x1ran(1))/nbpoints:x1ran(2);
x2 = x2ran(1):(x2ran(2)-x2ran(1))/nbpoints:x2ran(2);
[x11, x22] = meshgrid(x1, x2);
[dummy, x1x2out] = svmfwd(net, [x11(:),x22(:)]);
x1x2out = reshape(x1x2out, [length(x1) length(x2)]);
contour(x11, x22, x1x2out, [-0.99 -0.99], 'b-');
contour(x11, x22, x1x2out, [0 0], 'k-');
contour(x11, x22, x1x2out, [0.99 0.99], 'g-');
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
亚洲国产成人tv| 久久久国产午夜精品| www.欧美色图| 成人高清视频在线观看| 成人黄色一级视频| 成人网男人的天堂| av在线不卡观看免费观看| 波多野结衣欧美| 不卡欧美aaaaa| 色八戒一区二区三区| 欧美在线观看18| 欧美一区二区三区四区高清| 欧美一区二区在线看| 精品国产乱码久久久久久久| 精品国产乱码久久久久久闺蜜 | 亚洲妇女屁股眼交7| 亚洲一区二区3| 欧美aaaaaa午夜精品| 秋霞影院一区二区| 国产激情视频一区二区三区欧美 | 在线视频亚洲一区| 欧美日韩视频不卡| 精品久久久网站| 国产精品区一区二区三区| 亚洲欧美日韩国产一区二区三区 | 久久久久免费观看| 最新中文字幕一区二区三区| 亚洲最新在线观看| 久久av老司机精品网站导航| 成人动漫视频在线| 精品视频在线看| 国产网站一区二区| 亚洲午夜电影在线观看| 国产制服丝袜一区| 欧美亚洲国产一区在线观看网站 | 国产精品久久久久aaaa| 亚洲第一主播视频| 国产麻豆9l精品三级站| 99国产精品久久久| 日韩亚洲欧美在线| 亚洲区小说区图片区qvod| 日韩国产精品91| 99久久er热在这里只有精品66| 欧美视频三区在线播放| 国产清纯白嫩初高生在线观看91 | 一区二区三国产精华液| 老司机精品视频在线| 91免费精品国自产拍在线不卡| 日韩西西人体444www| 亚洲欧洲中文日韩久久av乱码| 免费成人在线观看视频| 欧美性色黄大片| 中文成人综合网| 精品一区二区三区免费播放| 91国偷自产一区二区三区观看| 国产亚洲成aⅴ人片在线观看| 亚洲资源中文字幕| 成人av影视在线观看| 2020国产精品自拍| 热久久免费视频| 欧美妇女性影城| 亚洲国产日产av| 91丨porny丨国产| 国产精品久久久久久久第一福利| 久久精品国产秦先生| 91精品国产色综合久久ai换脸| 亚洲色欲色欲www在线观看| 大胆亚洲人体视频| 国产清纯美女被跳蛋高潮一区二区久久w| 蜜臀久久久久久久| 日韩午夜小视频| 蜜臀av一区二区| 26uuu成人网一区二区三区| 免费在线视频一区| 欧美一区二区在线观看| 奇米在线7777在线精品| 日韩女优av电影| 久久国产精品99精品国产 | 国产成人免费视频| 久久综合99re88久久爱| 国产一区二区三区最好精华液| 欧美xxxxx牲另类人与| 久久99热国产| 久久久噜噜噜久久中文字幕色伊伊| 韩国v欧美v亚洲v日本v| 久久久亚洲精品一区二区三区| 精品一区二区三区日韩| 久久综合九色综合久久久精品综合| 国模大尺度一区二区三区| 国产亚洲精品福利| 99久久伊人精品| 亚洲一区二区精品视频| 在线成人av网站| 狠狠色狠狠色综合| 国产精品久久久久三级| 欧美中文字幕亚洲一区二区va在线 | 欧美白人最猛性xxxxx69交| 国产资源在线一区| 亚洲欧美综合在线精品| 欧美日韩三级在线| 国产在线播放一区二区三区| 中文字幕一区在线观看视频| 欧美综合在线视频| 国内精品久久久久影院一蜜桃| 中文字幕av一区 二区| 欧美在线观看一区二区| 久久爱另类一区二区小说| 亚洲欧洲精品天堂一级| 在线成人午夜影院| 高清不卡一区二区在线| 亚洲综合色网站| 精品国产污网站| 91一区二区在线| 激情另类小说区图片区视频区| 国产精品黄色在线观看| 91精品国产色综合久久不卡电影 | 一区二区三区不卡在线观看| 欧美一级午夜免费电影| 成人av网站免费| 久久精品国产在热久久| 亚洲一卡二卡三卡四卡无卡久久 | 午夜精品一区二区三区三上悠亚| 国产亚洲精久久久久久| 欧美猛男gaygay网站| 岛国一区二区在线观看| 男女男精品视频网| 亚洲综合免费观看高清完整版在线 | 国产精品麻豆99久久久久久| 欧美精品在线观看一区二区| 成人动漫精品一区二区| 国产自产2019最新不卡| 午夜精品久久久久久不卡8050| 国产日韩精品一区二区三区在线| 777午夜精品视频在线播放| 91小视频在线免费看| 国产网站一区二区三区| 精品国产伦一区二区三区免费| 91亚洲精品久久久蜜桃| 轻轻草成人在线| 亚洲乱码日产精品bd| 久久久久亚洲综合| 欧美va亚洲va香蕉在线| 欧美片在线播放| 91精品1区2区| 色综合天天在线| 不卡影院免费观看| 国产精品夜夜爽| 欧美bbbbb| 免费高清在线一区| 一区av在线播放| 一区二区三区不卡在线观看| 中文字幕va一区二区三区| 久久久不卡网国产精品一区| 欧美大片拔萝卜| 91精品国产综合久久久蜜臀粉嫩 | 精品中文字幕一区二区| 国产精品日产欧美久久久久| 免费在线观看精品| 国产精品不卡视频| 国产午夜精品一区二区三区四区| 日韩女优av电影在线观看| 欧美日韩日日夜夜| 欧美日韩国产综合视频在线观看| 亚洲高清免费视频| 亚洲一区二区三区四区五区黄| 性做久久久久久免费观看欧美| 久久国产精品无码网站| 国产成人av电影| 国产成人综合在线| 一个色综合av| 日韩和的一区二区| 国产在线视视频有精品| 亚洲成人资源在线| 奇米影视在线99精品| 亚洲国产精品久久人人爱| 2024国产精品| 久久综合久久久久88| 欧美系列日韩一区| 亚洲综合成人网| 亚洲国产欧美日韩另类综合 | 亚洲精品ww久久久久久p站| 精品综合久久久久久8888| 成人免费视频在线观看| 亚洲国产一二三| 石原莉奈在线亚洲二区| 亚洲免费观看在线视频| 欧美色图免费看| 精品国产成人在线影院| 欧美xxxx在线观看| 国产欧美一区二区三区在线看蜜臀 | 精品久久久久一区| 欧美福利一区二区| 中文字幕第一区二区| 午夜精品一区二区三区三上悠亚| 亚洲精品乱码久久久久久久久 | 日韩高清不卡在线| 欧美一级高清大全免费观看| 国产片一区二区| 亚洲综合一区二区三区| 狠狠色丁香久久婷婷综|