From 3d204f5fe4614624ca342090feecbfe4df188d9d Mon Sep 17 00:00:00 2001
From: Joe Zhao <ztuowen@gmail.com>
Date: Sun, 8 Mar 2015 22:25:52 +0800
Subject: scaffolding, tested

---
 main.cpp | 20 +++++++++++++++++---
 1 file changed, 17 insertions(+), 3 deletions(-)

(limited to 'main.cpp')

diff --git a/main.cpp b/main.cpp
index 87f9ce5..c297f30 100644
--- a/main.cpp
+++ b/main.cpp
@@ -15,16 +15,24 @@ po::variables_map vm;
 
 int train() {
     RSVM *rsvm;
-    rsvm = RSVM::loadModel(vm["model"].as<std::string>().c_str());
-    FileDP dp(vm["feature"].as<std::string>().c_str());
+    rsvm = RSVM::loadModel(vm["model"].as<std::string>());
+    FileDP dp(vm["feature"].as<std::string>());
+
+    // Generic training operations
+    dp.open();
     DataSet D;
     Labels L;
+    LOG(INFO)<<"Training started";
     while (!dp.EOFile())
     {
         dp.getDataSet(D);
         dp.getLabel(L);
         rsvm->train(D,L);
     }
+
+    LOG(INFO)<<"Training finished,saving model";
+
+
     rsvm->saveModel(vm["output"].as<std::string>().c_str());
     delete rsvm;
     return 0;
@@ -45,6 +53,12 @@ int predict() {
     return 0;
 }
 
+int validate()
+{
+    LOG(FATAL)<<"Not Implemented";
+    return 0;
+}
+
 int main(int argc, char **argv) {
     // Defining program options
     po::options_description desc("Allowed options");
@@ -73,7 +87,7 @@ int main(int argc, char **argv) {
     }
     else if (vm.count("validate")) {
         LOG(INFO) << "Program option: validate";
-        predict();
+        validate();
     }
     else if (vm.count("predict")) {
         LOG(INFO) << "Program option: predict";
-- 
cgit v1.2.3-70-g09d2