From 3a6466d2e196b98a412f8c8dd98562a3532a0ae8 Mon Sep 17 00:00:00 2001 From: Rahul Kavi Date: Wed, 7 Aug 2013 20:39:46 -0400 Subject: [PATCH] updated logistic regression sample program --- samples/cpp/sample_logistic_regression.cpp | 58 +++++++++++++++++----- 1 file changed, 45 insertions(+), 13 deletions(-) diff --git a/samples/cpp/sample_logistic_regression.cpp b/samples/cpp/sample_logistic_regression.cpp index 95649e3911..165ead3b52 100644 --- a/samples/cpp/sample_logistic_regression.cpp +++ b/samples/cpp/sample_logistic_regression.cpp @@ -16,6 +16,8 @@ #include #include +#include + using namespace std; using namespace cv; @@ -25,6 +27,10 @@ int main() { Mat data_temp, labels_temp; Mat data, labels; + + Mat data_train, data_test; + Mat labels_train, labels_test; + Mat responses, result; FileStorage f; @@ -44,6 +50,32 @@ int main() data_temp.convertTo(data, CV_32F); labels_temp.convertTo(labels, CV_32F); + for(int i =0;i(i,0)<<" :: "<< responses.at(i,0)<(i,0)<<" :: "<< responses.at(i,0)<