问题
Lets say my feature vector is (x1, x2, ...xn)
Could anyone give me a code to train one-class SVM using libSVM?
How should I learn the parameters using cross validation.
回答1:
This may help you
label=ones(Number Of your training instances,1); % You should generate labels for your only class!
model = svmtrain( label, Training Data , '-s 2 -t 2 -n 0.5' ) ; % You can change the parameters
[predicted_label,accuracy]=svmpredict(TestLabels,Test Set, model);
来源:https://stackoverflow.com/questions/14588967/one-class-svm-libsvm