How to do Leave-One-Subject-Out in Matlab?
20 次查看(过去 30 天)
显示 更早的评论
Hi, guys
I would like to use Leave-One-Subject-Out for classiffication purposes. In my case, I have a dataset from 16 subjects, containing acceleration traces.
I would like to use binary SVM to see the classification accuracy with unseen subject. Thus I would like to train the SVM on the data from 15 users and test on the one left. I was able to split the data based on this, but in this case if I train on the data of the 15 users, the SVM does not know the label of the 16th one ! so it would not report the positive label (of the 16 th user) and rather than that it will find the closest label, which is the one of the 15 users (as all of them have same label in binary SVM).
Your help is appreciate
Thank you
0 个评论
回答(1 个)
Shishir Singhal
2020-7-29
Hi,
Please refer to the documentation to implement "Leave one out cross validation": https://in.mathworks.com/help/stats/cvpartition.html#d120e209754
If all the data points have same label in train set, then it is highly likely that it would predict the same label for any test point. It is because your SVM thought that all the data points are belongs to the same distribution.
To solve this problem, it would recommend to increase the data size with some good ratio of positive and negative samples.
Thanks,
0 个评论
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Statistics and Machine Learning Toolbox 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!