sample data within margin of SVM

Hi, I am using fitcsvm & predict to train and test the classification data. Somehow, I need to find the number of samples within SVM margins so that a classification error can be estimated using the samples within the margin in terms of the total number of samples. I tried the option of "score" but I am not sure of the physical meaning of the score. Can anyone help me to count the samples within the margins?
Thanks in advance.

回答 (2 件)

Stephan
Stephan 2018 年 6 月 22 日

0 投票

Hi,
For calculation of the accuracy you could calculate the error from your crossvalidated model using
crossval
command at first and then calculate the error in form using the
kfoldloss
command. This gives you the error from your test set for your model which should mean:
accuracy = 1 - kfoldloss
These steps are shown with examples on the fitcsvm documentation site at the section Train and Cross-Validate SVM Classifier.
Best regards
Stephan
Tough Guy
Tough Guy 2018 年 6 月 24 日

0 投票

Thanks a lot! In fact, I was trying to measure the distance between the boundary (or margin) and data in the hyper plane so that I could choose the relatively bad data to train again in the next step (adaptive SVM?), and I thought the "score" could be used in this regard. In any case, thank you again for your help...

製品

リリース

R2018a

質問済み:

2018 年 5 月 12 日

回答済み:

2018 年 6 月 24 日

Community Treasure Hunt

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

Start Hunting!

Translated by