From a8a7bf5f9b9a1eb0d41f839afd06cc532356a902 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Sun, 26 Apr 2015 22:53:13 +0800 Subject: getAllData --- main.cpp | 40 +++++++++++++++++++++------------------- 1 file changed, 21 insertions(+), 19 deletions(-) (limited to 'main.cpp') diff --git a/main.cpp b/main.cpp index d5c6f69..cf1dd14 100644 --- a/main.cpp +++ b/main.cpp @@ -24,7 +24,7 @@ int train(DataProvider &dp) { DataList D; LOG(INFO)<<"Training started"; - dp.getDataSet(D); + dp.getAllData(D); LOG(INFO)<<"Read "<train(D); std::vector L; @@ -49,30 +49,32 @@ int predict(DataProvider &dp) { std::vector L; LOG(INFO)<<"Prediction started"; - dp.getDataSet(D); - LOG(INFO)<<"Read "<predict(D,L); + std::ofstream fout; + if (vm.count("output")) + fout.open(vm["output"].as().c_str()); - if (vm.count("validate")) + while (!dp.EOFile()) { - rank_accu(D,L); + dp.getDataSet(D); + LOG(INFO)<<"Read "<predict(D,L); + + if (vm.count("validate")) + { + rank_accu(D,L); + } + + if (vm.count("output")) + for (int i=0; i().c_str()); - - for (int i=0; i