From fd32eb3bfc64564d64401f9c2ee03b1557be9c71 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Wed, 11 Mar 2015 01:08:36 +0800 Subject: svm model struct --- model/ranksvm.h | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'model/ranksvm.h') diff --git a/model/ranksvm.h b/model/ranksvm.h index 5217b56..edb80f6 100644 --- a/model/ranksvm.h +++ b/model/ranksvm.h @@ -6,10 +6,15 @@ #include"../tools/dataProvider.h" #include "../tools/easylogging++.h" +typedef struct SVMModel{ + Eigen::VectorXd weight; + double beta; +} SVMModel; + class RSVM //Virtual base class for all RSVM operations { protected: - Eigen::VectorXd model; + SVMModel model; int fsize; public: virtual int train(DataSet &D, Labels &label)=0; @@ -19,9 +24,9 @@ public: int saveModel(const std::string fname); static RSVM* loadModel(const std::string fname); virtual std::string getName()=0; - Eigen::MatrixXd getModel(){ + SVMModel getModel(){ return model;}; - int setModel(const Labels &model); + int setModel(const SVMModel &model); }; #endif \ No newline at end of file -- cgit v1.2.3-70-g09d2