CSVM and SVM on 2 class dataset
2 次查看(过去 30 天)
显示 更早的评论
and I wanna do svm and csvm on the third and sixth features but I can not draw the line and just plot support vectors
this is my code right now
clc
clear all
close all
datas = csvread('pima-indians-diabetes.csv');
f3=datas(1:1:768,3);
f6=datas(1:1:768,6);
X=[f3 f6];
Y=datas(1:1:768,9);
SVMModel = fitcsvm(X,Y)
sv = SVMModel.SupportVectors;
figure
gscatter(X(:,1),X(:,2),Y)
hold on
plot(sv(:,1),sv(:,2),'ko','MarkerSize',10)
legend('1','0','Support Vector')
hold off
and is fitcsvm is svm or csvm?if its csvm how to define c and if its not what sholud I use instead?
0 个评论
回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
产品
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!