svm train_auto small sample size problem

asked 2014-02-27 04:12:11 -0500

Hello, I am trying to use SVM for face recognition. Since SVM is highly dependent to the parameters, accurate parameter estimation is crucial. I tried to use train_auto with a pre 3.0 version, but I got error "Bad argument (While cross-validation one or more of the classes have been fell out of the sample. Try to enlarge <cvsvmparams::k_fold>) in CvSVM::do_train". I have 200 subjects of 2 samples for each class (ba, bj subset of FERET database). What could be done to overcome this error? I tried different k 's for cross validation but did not work.

edit retag flag offensive close merge delete


I have the same problem for an n-classes problem. I took a look into the OpenCV 2.4.9 code (svm.cpp) and recognized that there is no functionality to take care of the class distribution for each fold. I am not sure but line 1963 - 1965 seams for me to be buggy because on the first fold if k == 0 nothing will be copied from sample to samples_local buffer.

1963: for(int k = 0; k < k_fold; k++ ) 1964: { 1965: memcpy( samples_local, samples, sizeof(samples[0])test_sizek );

tsenst gravatar imagetsenst ( 2014-09-29 09:02:39 -0500 )edit