-
-
Notifications
You must be signed in to change notification settings - Fork 56.5k
Closed
Labels
Description
System Information
OpenCV version: 4.6..0
Operating System / Platform: Ubuntu 24.04
Compiler: GCC 13.2.0
Detailed description
A value of the nu parameter to SVM ml algorithm (type NU_SVC) that is inconsistent with the distribution of labels of the training cases triggers a silent failure in the train() method. The problem is detected, but no error or warning printed--it just fails. Suggested change would be to replace the "// TODO" line with something like :
CV_Error( cv::Error::StsBadArg, "training cases incompatible with nu parameter--try a lower value");
The same issue exists in the current source at the time of this submission.
Steps to reproduce
The dog that did not bark is on line 1462 of module/ml/svm.cpp :
if( nu*(ci + cj)*0.5 > std::min( ci, cj ) )
// TODO: add some diagnostic
return false;
}
Issue submission checklist
- I report the issue, it's not a question
- I checked the problem with documentation, FAQ, open issues, forum.opencv.org, Stack Overflow, etc and have not found any solution
- I updated to the latest OpenCV version and the issue is still there
- There is reproducer code and related data files (videos, images, onnx, etc)
Reactions are currently unavailable