summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-03-08 22:25:52 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-03-08 22:25:52 +0800
commit3d204f5fe4614624ca342090feecbfe4df188d9d (patch)
treed6f5e8871bb43dfc550de562d1d2811bd1023445 /model
parentf2d01e30f459818f0589e06839d38999aecfdc06 (diff)
downloadranksvm-3d204f5fe4614624ca342090feecbfe4df188d9d.tar.gz
ranksvm-3d204f5fe4614624ca342090feecbfe4df188d9d.tar.bz2
ranksvm-3d204f5fe4614624ca342090feecbfe4df188d9d.zip
scaffolding, tested
Diffstat (limited to 'model')
-rw-r--r--model/ranksvm.cpp7
1 files changed, 4 insertions, 3 deletions
diff --git a/model/ranksvm.cpp b/model/ranksvm.cpp
index 6294245..060001b 100644
--- a/model/ranksvm.cpp
+++ b/model/ranksvm.cpp
@@ -12,7 +12,8 @@ int RSVM::saveModel(const string fname){
std::ofstream fout(fname.c_str());
fout<<this->getName()<<endl;
- fout<<this->model;
+ fout<<this->fsize<<endl;
+ Eigen::write_stream(fout, this->model);
return 0;
}
@@ -37,8 +38,8 @@ RSVM* RSVM::loadModel(const string fname){
}
int RSVM::setModel(const Eigen::VectorXd &model) {
- if (model.cols()!=fsize)
- LOG(FATAL) << "Feature size mismatch";
+ if (model.rows()!=fsize)
+ LOG(FATAL) << "Feature size mismatch: "<<fsize<<" "<<model.cols();
this->model=model;
return 0;
} \ No newline at end of file