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

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

?? demsvm2.m

?? LibSVM工具箱
?? M
字號:
function demsvm2()% DEMSVM2 - Demonstrate advanced Support Vector Machine features% %   DEMSVM2 demonstrates the classification of a simple artificial data%   set by a Support Vector Machine classifier. The features of the SVM%   routines that make it useful for large data sets are shown.%%   See also%   SVM, SVMTRAIN, SVMFWD, SVMKERNEL, DEMSVM2%% % Copyright (c) Anton Schwaighofer (2001)% $Revision: 1.4 $ $Date: 2001/04/19 23:29:48 $% mailto:anton.schwaighofer@gmx.net% % This program is released unter the GNU General Public License.% rand('seed', 1);randn('seed', 1);X = [2 7; 3 6; 2 2; 8 1; 6 4; 4 8; 9 5; 9 9; 9 4; 6 9; 7 4; 4 4];Y = [ +1;  +1;  +1;  +1;  +1;  -1;  -1;  -1;  -1;  -1;  -1;  -1];% define a simple artificial data setx1ran = [0 10];x2ran = [0 10];% range for plotting the data set and the decision boundarydisp(' ');disp('This demonstration illustrates the use of a Support Vector Machine');disp('(SVM) for classification.');disp(' ');disp('This Matlab implementation has a few special features that make');disp('its use on large data sets particularly efficient. We will in turn');disp('demonstrate a few of theses features on small artifial data sets.');disp(' ');disp('Press any key to plot the data set');pausef1 = 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('Now we train a Support Vector Machine classifier on this data set,');disp('we use the simple linear kernel.');disp('Training the SVM involves solving a quadratic programming (QP)');disp('problem that has as many variables as we have training points.');disp('This may result in huge time and memory consumption during');disp('training.');disp('This SVM toolbox uses a special decomposition algorithm proposed');disp('by Osuna, Freund and Girosi');disp('(ftp://ftp.ai.mit.edu/pub/cbcl/nnsp97-svm.ps)');disp('The QP problem is decomposed into smaller ones, the size of these');disp('small QP problems is controlled by the parameter net.qpsize');disp(' ');disp('We demonstrate the decomposition algorithm by setting net.qpsize');disp('to 6. In the SVM framework this means that we consider a set of');disp('6 examples (the ''working set'') at once and try to find the ');disp('separating hyperplane for this set of examples.');disp(' ');disp(' ');disp('Press any key to start training')pausedisp(' ');disp('************');disp(' ');net = svm(size(X, 2), 'linear', [], 100);net.qpsize = 6;net = svmtrain(net, X, Y, [], 2);disp(' ');disp('************');disp(' ');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)']);disp(' ');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 SVM has successfully found the set of Support Vectors without');disp('ever having to work with the whole set of examples.');disp(' ');disp('The decomposition algorithm works in such a way that the size of');disp('the small QP subproblems is independent of the number of Support');disp('Vectors. Thus complex data sets with a few thousand Support');disp('Vectors can be handled easily and efficiently by solving a series');disp('of small QP problems of size net.qpsize.');disp(' ');disp('Furthermore, a linear approximation of the objective function is');disp('used for selecting which examples to put into the working set for');disp('the next QP subproblem. This is based on the approximation');disp('proposed by Joachims, see');disp('http://www-ai.cs.uni-dortmund.de/DOKUMENTE/joachims_99a.ps.gz');disp('This approximation gives an excellent convergence behaviour.');disp(' ');disp('Usually it is not necessary to modify the default value');disp('for net.qpsize');disp(' ');disp('Press any key to continue')pausefprintf('\n\n\n\n');disp('We have just now trained a SVM with linear kernel. If the');disp('resulting classifier makes too many errors on the training');disp('set we might switch to a more powerful kernel function.');disp('We will now switch to a RBF kernel.');disp(' ');disp('Training a SVM means finding the Support Vectors - the examples');disp('that are on the boundary between the classes +1 and -1.');disp('If we change the kernel function and start the training again');disp('from scratch, we loose the previously obtained information on');disp('the Support Vectors. If a set of examples are Support Vectors');disp('when using a linear kernel, we may assume that at least a few');disp('of theses examples will again be Support Vectors when using ');disp('the RBF kernel.');disp(' ');disp('SVMTRAIN provides a way of incorporating this information since');disp('it is possible to set a start value for the coefficients alpha.');disp(' ');disp('We will now start the training again, using the RBF kernel. We');disp('will use the previously obtained alpha''s as the start values.');disp(' ');disp(' ');disp('Press any key to start training')pausedisp(' ');disp('************');disp(' ');alpha0 = net.alpha;net = svm(size(X, 2), 'rbf', [36], 100);net.qpsize = 6;net = svmtrain(net, X, Y, alpha0, 2);disp(' ');disp('************');disp(' ');f3 = 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');disp('It can be seen that the whole training is finished after fewer');disp('iterations than before. It turned out that the set of Support');disp('Vectors has indeed stayed the same when changing the kernel');disp('function.');disp(' ');disp('This features is particularly useful for testing the results of ');disp('different kernel functions on large data sets, for example');disp('  net1 = svm(nin, ''RBF'', 0.5);');disp('  net1 = svmtrain(net1, X, Y);');disp('  net2 = svm(nin, ''RBF'', 0.4);');disp('  net2 = svmtrain(net2, X, Y, net1.alpha);');disp('  net3 = svm(nin, ''RBF'', 0.3);');disp('  net3 = svmtrain(net3, X, Y, net2.alpha);');disp(' ');disp('Press any key continue');pausefprintf('\n\n\n\n');disp('Another feature that is useful for use with imbalanced data sets');disp('is to set different values for the upper bound C of the');disp('coefficients alpha. In a mechanical analogy, these coefficients');disp('can be viewed as forces ''pulling'' on the decision boundary. The');disp('larger a coefficient alpha is, the larger is the force the');disp('corresponding examples exerts on the decision surface. Thus the');disp('upper bound C for the coefficients alpha is equivalent to an');disp('upper bound for the force.');disp(' ');disp('If we now have an imbalanced data set with, say, 100 negative');disp('examples and 5 positive examples, we may allow the positive');disp('examples to exert a higher force on the decision boundary to');disp('compensate for their under-representation.');disp('We do this by setting different upper bounds C for the positive');disp('and the negative examples. Such a technique has been proposed by');disp('Veropoulos et.al. in the context of medical diagnosis, see');disp('http://lara.enm.bris.ac.uk/cig/gzipped/ijcai_ss.ps.gz');disp(' ');disp('We will now show the effect of different bounds for positive and');disp('negative examples on a simple data set. First we use an equal');disp('upper bound C for the positive and negative examples.');disp(' ');disp('Press any key to show decision boundary')pauseX = [2 7; 3 6; 6 3; 8 1; 6 4; 4 8; 9 5; 9 9; 9 4; 6 9; 7 4; 4 4; 4 6; ...     3 3];Y = [ +1;  +1;  -1;  +1;  +1;  -1;  -1;  -1;  -1;  -1;  -1;  -1;  -1; ...      +1];net = svm(size(X, 2), 'rbf', [128]);net.c = 100;net = svmtrain(net, X, Y);f6 = figure;plotboundary(net, x1ran, x2ran);plotdata(X, Y, x1ran, x2ran);plotsv(net, X, Y);title(['Decision boundary from SVM with upper bound C=100 for' ...       ' positive and negative examples']);fprintf('\n\n\n\n');disp('Now we use an upper bound of C=10 for the positive examples and');disp('C=100 for the negative examples.');disp(' ');disp('Press any key to show decision boundary')pausenet = svm(size(X, 2), 'rbf', [128]);net.c = [50 100];net = svmtrain(net, X, Y);f7 = figure;plotboundary(net, x1ran, x2ran);plotdata(X, Y, x1ran, x2ran);plotsv(net, X, Y);title(['Decision boundary from SVM with upper bound C=10 for' ...       ' positive examples (squares) and C=100 for negatives' ...       ' (crosses)']);fprintf('\n\n\n\n');disp('It can be seen clearly that the SVM now makes fewer errors on the');disp('negative examples, since errors on negative examples have a');disp('''penalty'' of C=100 associated with it, whereas errors on');disp('positive examples only have a penalty of C=10. The decision');disp('boundary has moved such that example 12 is the only one that is');disp('not correctly classified.');disp('(Recall that the actual decision boundary that separates the');disp('positive from the negative examples is plotted in black, the');disp('contour lines plotted in blue and green are the lines of');disp('distance +1 and -1 from the decision boundary. All examples that');disp('are in the margin (between the +1 and -1 lines) are seen as');disp('misclassifications.)');fprintf('\n\n\n\n');disp('Press any key to end the demo')pausedelete(f1);delete(f2);delete(f3);delete(f6);delete(f7);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一区二区三区免费野_久草精品视频
亚洲图片欧美激情| 久久精品国产秦先生| 国产精品护士白丝一区av| 精品美女在线观看| 欧美精品一区二区三区久久久| 91精品免费观看| 在线播放亚洲一区| 欧美疯狂性受xxxxx喷水图片| 欧美无砖砖区免费| 欧美四级电影网| 欧美日韩aaaaaa| 制服丝袜成人动漫| 日韩精品中文字幕一区二区三区| 精品美女一区二区三区| 精品欧美乱码久久久久久1区2区 | 日韩免费观看高清完整版| 91精品国产入口在线| 欧美日产在线观看| 欧美一区二区三区在线观看视频| 91精品久久久久久蜜臀| 欧美videossexotv100| 久久久久久久久久看片| 国产日产精品1区| 亚洲欧美自拍偷拍| 美腿丝袜在线亚洲一区| 韩国三级电影一区二区| 懂色av一区二区三区蜜臀| 91丨porny丨国产入口| 欧美性生活影院| 欧美一卡二卡在线| 久久久久久久久久久久久女国产乱 | 图片区日韩欧美亚洲| 美女视频第一区二区三区免费观看网站| 美日韩一区二区| 国产xxx精品视频大全| 色综合天天综合色综合av| 欧美精品乱码久久久久久按摩| 欧美大胆人体bbbb| 国产精品久久精品日日| 亚洲国产精品影院| 国产一区福利在线| 日本道色综合久久| 日韩一级成人av| 中文av字幕一区| 亚洲成人一区在线| 国产美女在线精品| 欧美系列一区二区| 久久免费看少妇高潮| 亚洲欧洲精品一区二区三区不卡| 香蕉久久一区二区不卡无毒影院| 国产精品综合二区| 欧美日韩国产一区| 国产精品久久久久三级| 日韩精品欧美精品| 成人激情免费电影网址| 91精品国产91久久久久久最新毛片| 国产校园另类小说区| 香蕉成人伊视频在线观看| 从欧美一区二区三区| 欧美一区三区四区| 日韩美女久久久| 精品一区二区在线看| 色94色欧美sute亚洲线路一久| 精品国产一区a| 亚洲va欧美va人人爽| 成人激情动漫在线观看| 日韩一区二区精品在线观看| 成人免费在线视频观看| 国产主播一区二区三区| 在线播放国产精品二区一二区四区| 日本一区二区三区dvd视频在线| 亚洲mv在线观看| av激情综合网| 日本一区二区三区电影| 紧缚奴在线一区二区三区| 欧美猛男gaygay网站| 最新成人av在线| 国产精品综合二区| 精品国产亚洲在线| 日韩精品一二三四| 国产精品热久久久久夜色精品三区| 青草国产精品久久久久久| 欧美在线一二三四区| 国产精品国产三级国产有无不卡 | 色综合久久久久综合体| 久久久久久久综合狠狠综合| 麻豆国产欧美一区二区三区| 欧美老女人在线| 亚洲影视在线观看| 91老师国产黑色丝袜在线| 国产欧美日韩不卡| 国产宾馆实践打屁股91| 久久久精品蜜桃| 国产一区二区三区综合| 欧美大度的电影原声| 日韩va欧美va亚洲va久久| 欧美美女bb生活片| 午夜精品在线视频一区| 欧美日韩一本到| 亚洲超碰精品一区二区| 欧美日韩免费电影| 亚洲一二三区不卡| 欧美在线一二三四区| 亚洲电影中文字幕在线观看| 欧美亚洲国产一区在线观看网站| 亚洲色图.com| 色一情一乱一乱一91av| 亚洲一区国产视频| 欧美精品日日鲁夜夜添| 日韩不卡一二三区| 欧美白人最猛性xxxxx69交| 老司机午夜精品| 久久影院视频免费| 国产精品99久久久久久似苏梦涵| 久久久久久97三级| 粉嫩久久99精品久久久久久夜 | 日本欧美大码aⅴ在线播放| 欧美一个色资源| 老司机精品视频在线| 久久中文字幕电影| 风间由美一区二区av101| 国产精品美女久久久久久久| 91免费在线播放| 亚洲一区二区三区三| 51精品国自产在线| 国产在线精品一区二区夜色| 久久久美女毛片| 99re热视频精品| 亚洲一区二区三区美女| 制服.丝袜.亚洲.中文.综合| 国产一区二区视频在线| 中文子幕无线码一区tr| 色呦呦国产精品| 免费观看在线综合色| 中文文精品字幕一区二区| 91婷婷韩国欧美一区二区| 亚洲成a人v欧美综合天堂下载| 欧美日韩电影在线| 国产福利精品一区| 一区二区三区中文在线| 777奇米成人网| 丁香网亚洲国际| 从欧美一区二区三区| 亚洲一区在线视频观看| 欧美精品一区二区三区很污很色的 | 经典三级一区二区| 亚洲少妇中出一区| 日韩欧美你懂的| 91色在线porny| 日韩av电影天堂| 国产亚洲1区2区3区| 欧美视频中文一区二区三区在线观看| 美腿丝袜亚洲色图| 国产精品传媒入口麻豆| 欧美精品九九99久久| 国产成人一区在线| 丝瓜av网站精品一区二区| 国产亚洲精品福利| 欧美日韩一区二区三区不卡| 国产精品77777| 日韩一区欧美二区| 亚洲欧美成aⅴ人在线观看| 欧美一级在线观看| 一本大道久久精品懂色aⅴ| 精品一区二区成人精品| 亚洲一区二区三区国产| 国产精品嫩草久久久久| 日韩三级在线免费观看| 91麻豆.com| 国产1区2区3区精品美女| 日韩成人午夜电影| 一区二区日韩电影| 国产精品久久久久婷婷| 精品久久久久久最新网址| 欧美系列亚洲系列| 99久久伊人久久99| 国产麻豆精品在线观看| 丝袜亚洲另类欧美| 一区二区欧美精品| 国产精品美女视频| 久久综合色8888| 欧美一级欧美三级在线观看| 91成人在线观看喷潮| 丰满少妇在线播放bd日韩电影| 日韩av中文字幕一区二区三区| 亚洲在线观看免费| 一区二区中文字幕在线| 国产精品网曝门| 国产日韩欧美麻豆| 久久亚洲私人国产精品va媚药| 欧美精品一卡两卡| 欧美日韩精品欧美日韩精品| 色综合天天综合给合国产| 成人小视频免费在线观看| 韩国精品久久久| 久久av老司机精品网站导航| 美女一区二区在线观看| 日本不卡一二三区黄网| 日韩国产精品久久| 99久久精品免费|