fix LR predict with raw output in 2-class case

In case of binary class, pred_m is initialized as zero vector and later
returned when raw outputs are requested, but it is never filled.
This commit is contained in:
Amro 2016-01-13 19:38:49 +02:00
parent 3d2fc6c2fd
commit e67178c696

View File

@ -266,6 +266,7 @@ float LogisticRegressionImpl::predict(InputArray samples, OutputArray results, i
{
temp_pred = calc_sigmoid(data_t*thetas.t());
CV_Assert(temp_pred.cols==1);
pred_m = temp_pred.clone();
// if greater than 0.5, predict class 0 or predict class 1
temp_pred = (temp_pred>0.5)/255;