mirror of
https://github.com/opencv/opencv.git
synced 2026-07-29 15:23:05 +04:00
ml: add checks of empty train data
This commit is contained in:
@@ -142,12 +142,10 @@ Ptr<LogisticRegression> LogisticRegression::load(const String& filepath, const S
|
||||
bool LogisticRegressionImpl::train(const Ptr<TrainData>& trainData, int)
|
||||
{
|
||||
CV_TRACE_FUNCTION_SKIP_NESTED();
|
||||
CV_Assert(!trainData.empty());
|
||||
|
||||
// return value
|
||||
bool ok = false;
|
||||
|
||||
if (trainData.empty()) {
|
||||
return false;
|
||||
}
|
||||
clear();
|
||||
Mat _data_i = trainData->getSamples();
|
||||
Mat _labels_i = trainData->getResponses();
|
||||
|
||||
Reference in New Issue
Block a user