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

相关文章:

  • 2022-01-12
  • 2022-12-23
  • 2022-12-23
  • 2021-10-18
  • 2021-09-21
  • 2022-01-15
  • 2021-04-08
  • 2022-02-04
猜你喜欢
  • 2021-12-06
  • 2021-11-18
  • 2021-11-21
  • 2021-04-24
  • 2022-12-23
  • 2021-12-07
  • 2021-11-09
相关资源
相似解决方案