码迷,mamicode.com
首页 > 其他好文 > 详细

MATLAB SVM

时间:2015-10-19 12:35:12      阅读:109      评论:0      收藏:0      [点我收藏+]

标签:

clc;
clear;
close all;

traindata = [1,0; 3,10; 2,2; 2,3; -1,-1; -6,-4; -4,-1; -1.5, -3];
group = [1 1 1 1 -1 -1 -1 -1]‘;

testdata = [ 1,2; 1,1; -1,-4;-2, -3];
svm_struct = svmtrain(traindata,group,‘Showplot‘,true); % training
Group = svmclassify(svm_struct,testdata,‘Showplot‘,true);
hold on;
plot(testdata(:,1),testdata(:,2),‘ro‘,‘MarkerSize‘,12); % testing
hold off

MATLAB SVM

标签:

原文地址:http://www.cnblogs.com/ahuo/p/4891297.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!