0
点赞
收藏
分享

微信扫一扫

MATLAB SVM

精进的医生 2022-05-19 阅读 53
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
举报

相关推荐

0 条评论