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 ?
1 | initial version |
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 ?
2 | No.2 Revision |
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 ?
3 | No.3 Revision |
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 ?
4 | retagged |
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 ?
5 | No.5 Revision |
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