How to train an SVM classifier and calculate performance

5 ビュー (過去 30 日間)
holistic
holistic 2016 年 8 月 1 日
回答済み: Samaneh Nemati 2019 年 12 月 2 日
Hi all,
I was already browsing through some similar question, but I still don't understand completely how to train an SVM classifier with matlab and afterwards calculate performance measures like AUC, Accuracy asf.
I managed to use fitcsvm to train a classifier and using leave-one-out cross-validation:
model=fitcsvm(data,groups,'Standardize',true,'ClassNames',{'group1','group2'},'Leaveout','on')
This works well, but how to calculate performance measures of my classifier after this step and plot the results?

回答 (2 件)

Swarooph
Swarooph 2016 年 8 月 1 日
You could do one of several things:
1. Resubstitution Loss calculation using resubLoss function
2. Loss calculation using loss function
  2 件のコメント
holistic
holistic 2016 年 8 月 2 日
Thank you! Perfcurve is what I want, but I'm not sure how to initialize it with the output from fitcsvm after leave-one-out cross-validation, i.e. where to find the "scores"?
Swarooph
Swarooph 2016 年 8 月 2 日
If you look at the examples in the documentation, it seems to be using fitPosterior followed by resubPredict function.

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


Samaneh Nemati
Samaneh Nemati 2019 年 12 月 2 日
you need to pass the output of svm classification (model) to predict function to get "label" and "scores".

カテゴリ

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