From d367e159c13ccb39fb44a236b52615d898fc7ecb Mon Sep 17 00:00:00 2001 From: Abe Friesen Date: Mon, 2 Nov 2015 17:36:27 -0800 Subject: [PATCH] Added cast to float to remove warning --- modules/ml/src/lr.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/ml/src/lr.cpp b/modules/ml/src/lr.cpp index 988aa313ed..a378947914 100644 --- a/modules/ml/src/lr.cpp +++ b/modules/ml/src/lr.cpp @@ -303,7 +303,7 @@ float LogisticRegressionImpl::predict(InputArray samples, OutputArray results, i } } - return ( pred_labs.empty() ? 0 : pred_labs.at< int >( 0 ) ); + return ( pred_labs.empty() ? 0.f : (float) pred_labs.at< int >( 0 ) ); } Mat LogisticRegressionImpl::calc_sigmoid(const Mat& data) const