From f2d01e30f459818f0589e06839d38999aecfdc06 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Sun, 8 Mar 2015 17:47:33 +0800 Subject: scaffolding --- model/ranksvm.h | 6 ++++-- model/ranksvmtn.cpp | 12 ++++++++++++ model/ranksvmtn.h | 5 ++--- 3 files changed, 18 insertions(+), 5 deletions(-) create mode 100644 model/ranksvmtn.cpp (limited to 'model') diff --git a/model/ranksvm.h b/model/ranksvm.h index e7b7c4a..21fb30b 100644 --- a/model/ranksvm.h +++ b/model/ranksvm.h @@ -12,8 +12,10 @@ protected: Eigen::VectorXd model; int fsize; public: - virtual int train(DataProvider &D)=0; // Dataprovider will have to provide label - virtual int predict(DataProvider &D)=0; // TODO Not sure how to construct this + virtual int train(DataSet &D, Labels &label)=0; + virtual int predict(DataSet &D, Eigen::MatrixXd &res)=0; + // TODO Not sure how to construct this + // Possible solution: generate a nxn matrix each row contains the sorted list of ranker result. int saveModel(const std::string fname); static RSVM* loadModel(const std::string fname); virtual std::string getName()=0; diff --git a/model/ranksvmtn.cpp b/model/ranksvmtn.cpp new file mode 100644 index 0000000..ef8d98c --- /dev/null +++ b/model/ranksvmtn.cpp @@ -0,0 +1,12 @@ +#include "ranksvmtn.h" + +using namespace std; +using namespace Eigen; + +int RSVMTN::train(DataSet &D, Labels &label){ + return 0; +}; + +int RSVMTN::predict(DataSet &D, MatrixXd &res){ + return 0; +}; \ No newline at end of file diff --git a/model/ranksvmtn.h b/model/ranksvmtn.h index 4a0fb16..21b03bd 100644 --- a/model/ranksvmtn.h +++ b/model/ranksvmtn.h @@ -12,9 +12,8 @@ public: { return "TN"; }; - - int train(DataProvider &D){return 0;}; - int predict(DataProvider &D){return 0;}; + virtual int train(DataSet &D, Labels &label); + virtual int predict(DataSet &D, Eigen::MatrixXd &res); }; #endif \ No newline at end of file -- cgit v1.2.3-70-g09d2