Skip to content

Commit 7621cc1

Browse files
committed
Merge pull request opencv#9054 from zhmu:upstream
2 parents 4f01ad8 + 3ce1bca commit 7621cc1

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

modules/ml/src/data.cpp

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -403,7 +403,7 @@ class TrainDataImpl : public TrainData
403403
Mat(tempCatMap).copyTo(catMap);
404404
}
405405

406-
if( varType.at<uchar>(ninputvars) == VAR_CATEGORICAL )
406+
if( noutputvars > 0 && varType.at<uchar>(ninputvars) == VAR_CATEGORICAL )
407407
{
408408
preprocessCategorical(responses, &normCatResponses, labels, &counters, sortbuf);
409409
Mat(labels).copyTo(classLabels);

0 commit comments

Comments
 (0)