diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-03-08 22:25:52 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-03-08 22:25:52 +0800 |
commit | 3d204f5fe4614624ca342090feecbfe4df188d9d (patch) | |
tree | d6f5e8871bb43dfc550de562d1d2811bd1023445 /main.cpp | |
parent | f2d01e30f459818f0589e06839d38999aecfdc06 (diff) | |
download | ranksvm-3d204f5fe4614624ca342090feecbfe4df188d9d.tar.gz ranksvm-3d204f5fe4614624ca342090feecbfe4df188d9d.tar.bz2 ranksvm-3d204f5fe4614624ca342090feecbfe4df188d9d.zip |
scaffolding, tested
Diffstat (limited to 'main.cpp')
-rw-r--r-- | main.cpp | 20 |
1 files changed, 17 insertions, 3 deletions
@@ -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"; |