Reputation: 5147
I'm using libsvm library in my project and have recently discovered that it provides out-of-the-box cross validation. I'm checking the documentation and it says clearly that I have to call svm-train with -n switch to use CV feature . When I call it with -v switch I cannot get a model file which is needed by svm-predict.
Implementing Support Vector Machine from scratch is beyond the scope of my project, so I'd rather fix this one if it is broken or ask the community for support.
Can anybody help with that?
Here's the link to the library, implemented in C and C++, and here is the paper that describes how to use it.
Upvotes: 2
Views: 2553
Reputation: 1402
Cause libsvm use cv only for parameter selection.
From libsvm FAQ:
Q: After doing cross validation, why there is no model file outputted ? Cross validation is used for selecting good parameters. After finding them, you want to re-train the whole data without the -v option.
If you are going to use cv for estimating quality of classifier on your data you should implement external cross validation by splitting data, train on some part and test on other.
Upvotes: 3
Reputation: 13289
It's been a while since I used libsvm so I don't think I have the answer you're looking, but if you run the cross-validation and are satisfied with the results, running lib-svm with the same parameters without the -v
will yield the same model.
Upvotes: 1