提交 3ce1bca6 编写于 作者: R Rink Springer 提交者: Rink Springer

Prevent crash when attempting to create training data without responses.

This is at least useful when using an SVM one-class linear classifier, so there are valid use cases.
上级 a84a5e8f
...@@ -403,7 +403,7 @@ public: ...@@ -403,7 +403,7 @@ public:
Mat(tempCatMap).copyTo(catMap); Mat(tempCatMap).copyTo(catMap);
} }
if( varType.at<uchar>(ninputvars) == VAR_CATEGORICAL ) if( noutputvars > 0 && varType.at<uchar>(ninputvars) == VAR_CATEGORICAL )
{ {
preprocessCategorical(responses, &normCatResponses, labels, &counters, sortbuf); preprocessCategorical(responses, &normCatResponses, labels, &counters, sortbuf);
Mat(labels).copyTo(classLabels); Mat(labels).copyTo(classLabels);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册