简体   繁体   中英

Really low accuracy with SVM + matlab and libsvm

I cannot figure the low accuracy obtained by running svm on speech vectors. I have cross verified that the data is not wrong and have even used a naives bayes classifier on it to get good results.

First of all I should mention that I have verified that I am not using the same files for training and testing.

I have a set of data for positive and negative class that I use for training

  pos = ones(size(PositiveTraining,1),1);
  neg = ones(size(NegativeTraining,1),1)*-1;



  Training = [ PositiveTraining ; NegativeTraining ];
  TrainingLabels = [pos;neg];

  model = svmtrain( TrainingLabels , Training, '-t 0' );

After obtaining the model I am testing the vectors using the following code

testing_label_vector = ones(size(mfcc,1),1); % where mfcc is my testing matrix
[predicted_label, a, b ] = svmpredict(testing_label_vector, File.mfcc, model );
edges = [-1,1];
hist = histc( predicted_label , edges )

However I find accuracy ranging from 0% to 13% maximum.

Is there any thing that I am doing wrong ?

Assuming the data is correct can somebody suggest me how I can increase the accuracy of the classifier ?

You need to do parameter selection - you are just using the default parameters. SVM is very sensitive to its parameters. The linear kernel has no parameters, but you still have the penalty parameter C. This parameter trades off between a larger margin and misclassified training points. Larger C will mean that the classifier will try to classify all the training points correctly, but this may not generalize well. Smaller C will allow some points to be misclassified to provide a model that is less sensitive to noise. The value of C is different for every dataset, as it depends greatly on the scaling and distribution, etc. It's also possible that your dataset is not linearly separable, even for low values of C, so perhaps a non-linear kernel would work better, such as the RBF kernel, which is popular. However, keep in mind those kernels have more parameters and they have to be tuned to work well.

Read the guide written by the authors of libsvm, it talks about how to do parameter selection and gives other practical tips for using SVM for classification.

A Practical Guide to Support Vector Classication by Chih-Wei Hsu, Chih-Chung Chang, and Chih-Jen Lin

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM