diff options
author | Joe Zhao <ztuowen@gmail.com> | 2015-06-11 14:19:16 +0800 |
---|---|---|
committer | Joe Zhao <ztuowen@gmail.com> | 2015-06-11 14:19:16 +0800 |
commit | e80d3cbbdc61c28fffbd75530888aa56f6ac15b1 (patch) | |
tree | 0c6ddf24e3822f3d9755308bc9299262bf82c884 /train.cpp | |
parent | 93b28277476de5d4fbfbf5ac236f9f619d482c46 (diff) | |
download | ranksvm-e80d3cbbdc61c28fffbd75530888aa56f6ac15b1.tar.gz ranksvm-e80d3cbbdc61c28fffbd75530888aa56f6ac15b1.tar.bz2 ranksvm-e80d3cbbdc61c28fffbd75530888aa56f6ac15b1.zip |
fscore
Diffstat (limited to 'train.cpp')
-rw-r--r-- | train.cpp | 12 |
1 files changed, 12 insertions, 0 deletions
@@ -48,6 +48,8 @@ int predict(DataProvider &dp) { RidList D; vector<double> L; CMC cmc; + Fscore f; + LOG(INFO)<<"Prediction started"; ofstream fout; @@ -82,6 +84,15 @@ int predict(DataProvider &dp) { *ot<<pair[i]<<endl; } else + if (vm.count("fscore")) + { + vector<double> pair; + f.audit(D); + pair=f.getFscore(); + for (int i=0;i<D.getfSize();++i) + *ot<<pair[i]<<endl; + } + else for (int i=0; i<L.size();++i) *ot<<L[i]<<endl; } @@ -121,6 +132,7 @@ int main(int argc, char **argv) { ("debug,d", "show debug messages") ("single,s", "one from a pair") ("pair,p","get pair result") + ("fscore,f","get F-score") ("model,m", po::value<string>(), "set input model file") ("output,o", po::value<string>(), "set output model/prediction file") ("feature,i", po::value<string>(), "set input feature file") |