Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

SVM predict error

I used the opencv CVSVM classifier 1 vs 24 auto_train() method . I try the classifier with same data-set with the predict method but the result not all my examples classifier can classify why ?

SVM predict error

I used the opencv CVSVM classifier 1 vs 24 auto_train() method . I try the classifier with same data-set with the predict method but the result not all my examples classifier can classify why ? If i test the classifier with same training set that should give me 100% accuracy isn't it ?

SVM Why does the CVSVM predict errorfunction does'nt work 100% on the same training set

I used the opencv CVSVM classifier 1 vs 24 auto_train() method . I try the classifier with same data-set with the predict method but the result not all my examples classifier can bag of visual words to classify why ? If objects ,once i finish training i test the classifier with on the same training set that should as this supposed give me 100% accuracy isn't it ? but that not the situation can someone explain why ?

Why does the CVSVM predict function does'nt work 100% on the same training set

I used the opencv CVSVM with bag of visual words to classify objects ,once i finish training i test the classifier on the same training set as this supposed give me 100% accuracy isn't it ? but that not the situation can someone explain why ?

Why does the CVSVM predict function does'nt work 100% on the same training set

I used the opencv CVSVM with bag of visual words to classify objects ,once i finish training i test the classifier on the same training set as this supposed give me 100% accuracy isn't it ? but that not the situation can someone explain why ?? Here's the code

 //load some class_1 samples into matrix
//load the associated SVM parameter file into SVM
//test (predict)
Mat test_samples;
CvSVM classifier;


FileStorage fs ("train_sample/training_samples-1000.yaml.gz" , FileStorage::READ) ;
if ( !fs.isOpened() ){
    cerr << "Cannot open file " << endl ;
    return ;
}

classifier.load("SVM_parameter_files/svm_1000_auto/SVM_classifier_class_1.yaml") ;
string class_= "class_";
for ( size_t i = 1 ; i <= 24; i++ ){
    stringstream ss ;
    ss << class_ <<i ;
    fs[ss.str()] >>test_samples;
    size_t positive  =  0 ;
    size_t negative = 0 ; 
    //test svm classifier that classify class_1 as positive and others as negative
    for ( int i = 0 ; i < test_samples.rows ; i++ ){
        float res = classifier.predict(test_samples.row(i),false  ) ;
       ( (res == 1) ? (positive++):(negative++) );

    }

    cout << ss.str() << " positive examples  = " <<positive <<" , negative examples =" << negative  << endl ;

}
fs.release();

The output class1 vs 24 class