CvSVM::auto_train seems broken when called with set of selected features (Bug #56)


Added by Michel Valstar about 15 years ago. Updated about 15 years ago.


Status:Done Start date:
Priority:High Due date:
Assignee:- % Done:

0%

Category:ml
Target version:-
Affected version: Operating System:
Difficulty: HW Platform:
Pull request:

Description

According to the manual, it should be possible to call CvSVM::auto_train with a set of selected features. When I call the following:

// -- Create set of n selected features (CvMat* row-vector)
const int* ofi = orderedFeats.ptr<int>(0);
for (int i = 0; i < n; i++) sfi[i] = ofi[i];

// -- Train using this subset of features
CvSVM svr0 = CvSVM();
svr0.train_auto(const_cast<const CvMat*> (cvFeatures), const_cast<const CvMat*> (cvLabels), sf, NULL, params, k_fold_train);

I get the following error:

OpenCV Error: Sizes of input arguments do not match (The sample size is different from what has been used for training) in cvPreparePredictData, file /Users/michel/macCode/opencv-2.0/src/ml/ml_inner_functions.cpp, line 1116
terminate called after throwing an instance of 'cv::Exception'
Program received signal: “SIGABRT”.

Is there a chance that feature selection is actually unsupported atm?


Associated revisions

Revision 634fedc3
Added by Andrey Kamaev over 12 years ago

Merge pull request #56 from vpisarev/bug_2447_2.4

History

Updated by Maria Dimashova about 15 years ago

Feature selection is supported.
Bugs have been fixed in revision 2691.

  • Status changed from Open to Done
  • (deleted custom field) set to fixed

Also available in: Atom PDF