Commit e67178c6 authored by Amro's avatar Amro

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.
parent 3d2fc6c2
......@@ -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;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment