summaryrefslogtreecommitdiff
path: root/train.cpp
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-05-18 22:22:11 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-05-18 22:22:11 +0800
commitdef2bcd3f41a36e52b179aa435c5bf29c94dab5e (patch)
treeeaf8673aa3d682e5d29f88f56fe5d38892de7858 /train.cpp
parentd2b066e22c6d76928fc037bd858f1baa082a8fe1 (diff)
downloadranksvm-def2bcd3f41a36e52b179aa435c5bf29c94dab5e.tar.gz
ranksvm-def2bcd3f41a36e52b179aa435c5bf29c94dab5e.tar.bz2
ranksvm-def2bcd3f41a36e52b179aa435c5bf29c94dab5e.zip
added openmp directivesingle
Diffstat (limited to 'train.cpp')
-rw-r--r--train.cpp29
1 files changed, 13 insertions, 16 deletions
diff --git a/train.cpp b/train.cpp
index 039c93a..0b5b4d4 100644
--- a/train.cpp
+++ b/train.cpp
@@ -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"))
{