diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-05-18 22:22:11 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-05-18 22:22:11 +0800 |
commit | def2bcd3f41a36e52b179aa435c5bf29c94dab5e (patch) | |
tree | eaf8673aa3d682e5d29f88f56fe5d38892de7858 /train.cpp | |
parent | d2b066e22c6d76928fc037bd858f1baa082a8fe1 (diff) | |
download | ranksvm-def2bcd3f41a36e52b179aa435c5bf29c94dab5e.tar.gz ranksvm-def2bcd3f41a36e52b179aa435c5bf29c94dab5e.tar.bz2 ranksvm-def2bcd3f41a36e52b179aa435c5bf29c94dab5e.zip |
added openmp directivesingle
Diffstat (limited to 'train.cpp')
-rw-r--r-- | train.cpp | 29 |
1 files changed, 13 insertions, 16 deletions
@@ -43,7 +43,7 @@ int predict(DataProvider &dp) { rsvm = RSVM::loadModel(vm["model"].as<string>().c_str()); dp.open(); - DataList D; + RidList D; vector<double> L; CMC cmc; LOG(INFO)<<"Prediction started"; @@ -59,24 +59,21 @@ int predict(DataProvider &dp) { else ot=&cout; - while (!dp.EOFile()) - { - dp.getDataSet(D); - LOG(INFO)<<"Read "<<D.getSize()<<" entries with "<< D.getfSize()<<" features"; - rsvm->predict(D,L); - - if (vm.count("validate")) - { - rank_accu(D,L); - if (vm.count("cmc")) - rank_CMC(D,L,cmc); - } + dp.getAllDataSet(D); + LOG(INFO)<<"Read "<<D.getSize()<<" entries with "<< D.getfSize()<<" features"; + rsvm->predict(D,L); - if (vm.count("output") && vm.count("predict")) - for (int i=0; i<L.size();++i) - *ot<<L[i]<<endl; + if (vm.count("validate")) + { + rank_accu(D,L); + if (vm.count("cmc")) + rank_CMC(D,L,cmc); } + if (vm.count("output") && vm.count("predict")) + for (int i=0; i<L.size();++i) + *ot<<L[i]<<endl; + LOG(INFO)<<"Finished"; if (vm.count("cmc")) { |