필터 지우기
필터 지우기

CSVM and SVM on 2 class dataset

조회 수: 4 (최근 30일)
alex
alex 2022년 11월 4일
Hi I have this dataset ' pima-indians-diabetes' have 8 features with 2 classes (0 and 1)
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개)

카테고리

Help CenterFile Exchange에서 Get Started with MATLAB에 대해 자세히 알아보기

제품

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!

Translated by