Confusion Matrix of SVM

6 ビュー (過去 30 日間)
Lana Aydin
Lana Aydin 2020 年 11 月 4 日
コメント済み: Lana Aydin 2020 年 11 月 10 日
Hello
I would like to ask about how to find the valure of Linear, Gaussian, Poly = 2, Poly = 3 for dataset of iris
I used the code bellow it runs without problem but I don't know how to calculate the value of them
t = templateSVM('Standardize',true,'BoxConstraint',100,'KernelFunction','linear','KernelScale','auto');
Mdl = fitcecoc(dataTrain(:,2:4),dataTrain.Species,'Learners',t);
Predictions_SVM_Linear = predict(Mdl,dataTest(:,2:4));
figure;
C_SVM_Linear = confusionmat(dataTest.Species,Predictions_SVM_Linear);
cm_SVM_Linear = confusionchart(C_SVM_Linear,{'Iris-setosa','Iris-versicolor','Iris-virginia'});
cm_SVM_Linear.Title = 'Iris Classification Using Linear SVM';
cm_SVM_Linear.RowSummary = 'row-normalized';
cm_SVM_Linear.ColumnSummary = 'column-normalized';

回答 (1 件)

Pranav Verma
Pranav Verma 2020 年 11 月 10 日
Hi Baraah,
From your question I understand that you want to use Linear, Gaussian and Polynomial Kernel functions in templateSVM function. You can use the following name, value pairs for these:
  • 'KernelFunction','gaussian'
  • 'KernelFunction','linear'
  • 'KernelFunction','polynomial','PolynomialOrder',2 (for polynomial of order '2')
For further information on the Kernel Functions, please refer to the below documentation:
Thanks
  1 件のコメント
Lana Aydin
Lana Aydin 2020 年 11 月 10 日
Ok thank you Pranav, I will check it out. Thanks again.

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

カテゴリ

Help Center および File ExchangeStatistics and Machine Learning Toolbox についてさらに検索

タグ

Community Treasure Hunt

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

Start Hunting!

Translated by