SVM: Using the same dataset for training and testing gives different results
Show older comments
I'm using the function 'fitcsvm' to train an SVM with a polynomial kernel on a dataset with 4 classes using a one-versus-all approach. To do a sanity check, I tried applying the resultant model to the same dataset I used for training using the function 'predict'. I predict labels for all observations for each SVM and I choose the label corresponding to the SVM with the highest posterior probability for a particular observation as its final label. However, the training and test errors aren't exactly the same. What is the reason behind this?
1 Comment
John Chilleri
on 15 Feb 2017
From what it sounded like, your training and testing sets are the same. Make sure whatever you train on is not in your testing set.
Answers (0)
Categories
Find more on Classification in Help Center and File Exchange
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!