电脑桌面
添加小米粒文库到电脑桌面
安装后可以在桌面快捷访问

Matlab的SVM算法进行线性和非线性分类实例_20131128VIP免费

Matlab的SVM算法进行线性和非线性分类实例_20131128_第1页
1/6
Matlab的SVM算法进行线性和非线性分类实例_20131128_第2页
2/6
Matlab的SVM算法进行线性和非线性分类实例_20131128_第3页
3/6
1 Matlab_sv mtranin_ex ample 1. Linear classification %Two Dimension Linear-SVM Problem, Two Class and Separable Situation %Method from Christopher J. C. Burges: %"A Tutorial on Support Vector Machines for Pattern Recognition", page 9 %Optimizing ||W|| directly: % Objective: min "f(A)=||W||" , p8/line26 % Subject to: yi*(xi*W+b)-1>=0, function (12); clear all; close all clc; sp=[3,7; 6,6; 4,6;5,6.5] % positive sample points nsp=size(sp); sn=[1,2; 3,5;7,3;3,4;6,2.7] % negative sample points nsn=size(sn) sd=[sp;sn] lsd=[true true true true false false false false false] Y = nominal(lsd) figure(1); subplot(1,2,1) plot(sp(1:nsp,1),sp(1:nsp,2),'m+'); hold on plot(sn(1:nsn,1),sn(1:nsn,2),'c*'); subplot(1,2,2) svmStruct = svmtrain(sd,Y,'showplot',true); 2. NonLinear classification %Two Dimension quadratic-SVM Problem, Two Class and Separable Situation %Method from Christopher J. C. Burges: %"A Tutorial on Support Vector Machines for Pattern Recognition", page 9 %Optimizing ||W|| directly: % Objective: min "f(A)=||W||" , p8/line26 % Subject to: yi*(xi*W+b)-1>=0, function (12); clear all; 2 close all clc; sp=[3,7; 6,6; 4,6; 5,6.5] % positive sample points nsp=size(sp); sn=[1,2; 3,5; 7,3; 3,4; 6,2.7; 4,3;2,7] % negative sample points nsn=size(sn) sd=[sp;sn] lsd=[true true true true false false false false false false false] Y = nominal(lsd) figure(1); subplot(1,2,1) plot(sp(1:nsp,1),sp(1:nsp,2),'m+'); hold on plot(sn(1:nsn,1),sn(1:nsn,2),'c*'); subplot(1,2,2) % svmStruct = svmtrain(sd,Y,'Kernel_Function','linear', 'showplot',true); svmStruct = svmtrain(sd,Y,'Kernel_Function','quadratic', 'showplot',true); % use the trained svm (svmStruct) to classify the data RD=svmclassify(svmStruct,sd,'showplot',true) % RD is the classification result vector 3. Svmtrain svmtrain...

1、当您付费下载文档后,您只拥有了使用权限,并不意味着购买了版权,文档只能用于自身使用,不得用于其他商业用途(如 [转卖]进行直接盈利或[编辑后售卖]进行间接盈利)。
2、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。
3、如文档内容存在违规,或者侵犯商业秘密、侵犯著作权等,请点击“违规举报”。

碎片内容

Matlab的SVM算法进行线性和非线性分类实例_20131128

确认删除?
VIP
微信客服
  • 扫码咨询
会员Q群
  • 会员专属群点击这里加入QQ群
客服邮箱
回到顶部