フィルターのクリア

How to use fitcsvm in matlab classifications Brain tumor Mr image?(Benign,Malignant)

3 ビュー (過去 30 日間)
Ahmet Gürbüz
Ahmet Gürbüz 2017 年 12 月 16 日
コメント済み: Saad Rana 2022 年 6 月 24 日
load egitimseti.mat xdata = meas; group = label;
%svmStruct1 = svmtrain(xdata,group,'kernel_function', 'linear');
%Train the SVM Classifier
SVMModel= fitcsvm(meas,group,'KernelFunction','rbf','BoxConstraint',Inf);
sv = SVMModel.SupportVectors;
figure,
gscatter(xdata(:,1),xdata(:,2),group);
hold on
plot(sv(:,1),sv(:,2),'ko','MarkerSize',10)
legend('MALIGNANT','BENIGN','Support Vector')
hold off
%species = svmclassify(svmStruct1,feat,'showplot',false
%x = fitcdiscr(xdata,group); label= predict(SVMModel,xdata);
%data1 = [meas(:,1),meas(:,2)]; %newfeat = [feat(:,1),feat(:,2)];
%close all
%SVMModel2=fitcsvm(data1,group); %label2=predict(SVMModel2,newfeat);
%En yüksek doğruluk(accurasy) icin trainset
data = meas; groups = ismember(label,'BENIGN'); groups = ismember(label,'MALIGNANT'); [train,test] = crossvalind('HoldOut',groups);%test ve egitim icin veriler karıstırıldı.0 ve 1 cp = classperf(groups);
%svmStruct = svmtrain(data(train,:),groups(train),'showplot',false,'kernel_function','linear');%yapi olustu%r %classes = svmclassify(svmStruct,data(test,:),'showplot',false);%svm ile sınıflandır SVMModelson=fitcsvm(data(train,:),groups(train)); class=predict(SVMModelson,data(test,:));
classperf(cp,class,test);
indicies = crossvalind('Kfold',label,10); cp = classperf(label);%for ;
%svmStruct = svmtrain(xdata(train,:),group(train),'boxconstraint',Inf,'showplot',false,'kernel_function','rbf');
%classes = svmclassify(svmStruct,xdata(test,:),'showplot',false);
SVMModelnormalize=fitcsvm(xdata(train,:),group(train));
classes=predict(SVMModelnormalize,xdata(test,:));
classperf(cp,classes,test);
%end
%çapraz geçerlilik sonucu
Accuracy = cp.CorrectRate*100; sprintf("Dogruluk oranı %d dir",Accuracy);
  5 件のコメント
lamis ke
lamis ke 2020 年 8 月 7 日
same question how to create load egitimseti.mat xdata = meas; group = label;
Saad Rana
Saad Rana 2022 年 6 月 24 日
The code gives an error for
load egitimseti.mat
xdata = meas;
group = label;
can you help me to create .mat file?

サインインしてコメントする。

回答 (1 件)

Bernhard Suhm
Bernhard Suhm 2017 年 12 月 20 日
Can you illustrate what your data looks like, and where you get what type of error? And which release of MATLAB are you using? Looks like you were on an old release at first, since svmtrain has long been depracated.
  2 件のコメント
Ahmet Gürbüz
Ahmet Gürbüz 2017 年 12 月 20 日
the training set consists of 20 rows and 4 columns o meas = 4 features for good and malignant 20 tumors
Image Analyst
Image Analyst 2017 年 12 月 20 日
You can help us to help you.
Of course it always starts by you answering direct questions people ask, which you aren't doing (yet).

サインインしてコメントする。

カテゴリ

Help Center および File ExchangeAgriculture についてさらに検索

Community Treasure Hunt

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

Start Hunting!

Translated by