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.
pull/5964/head
Amro 9 years ago
parent 3d2fc6c2fd
commit e67178c696
  1. 1
      modules/ml/src/lr.cpp

@ -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;

Loading…
Cancel
Save