svm_dec_bnd.m

来自「matlab神经网络代码」· M 代码 · 共 36 行

M
36
字号
function svm_dec_bnd(pesos, vect, b, escala)% function svm_dec_bnd(pesos, vect, b, escala)%%  plots the decision boundary for the two class Gaussian problem%  type "help svm_rbf" for variable description%% Hugh Pasika 1997y =-5:0.05:5;x = y';  x = x(:,ones(1,length(x)));y = x';  x = x(:);  y = y(:); z=zeros(size(x));for i=1:length(pesos)        z=z+pesos(i)*exp(-((x-vect(i,1)).^2+(y-vect(i,2)).^2)/escala);endz=z+b; co=pl_circ([-2/3,0],2.34,.005);zz=zeros(201,201);zz(:)=z; y =-5:0.05:5; x = y; contour(x,y,flipud(zz'),[0 0], '-')hold onplot(co(:,1),co(:,2),'--')hold offgrid onset(gca,'DataAspectRatio',[.9 1 1])legend('SVM','Bayes')title('Support Vector Machine Decision Boundary for Two Gaussian Problem')

⌨️ 快捷键说明

复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?