summaryrefslogtreecommitdiff
path: root/model
diff options
context:
space:
mode:
authorJoe Zhao <ztuowen@gmail.com>2015-03-08 17:47:33 +0800
committerJoe Zhao <ztuowen@gmail.com>2015-03-08 17:47:33 +0800
commitf2d01e30f459818f0589e06839d38999aecfdc06 (patch)
tree9530ac898c1d4cdecbb5194cbd76288e57f7f7b1 /model
parent22882d7113c13cb1e00c59b54050f16ac1b7cc30 (diff)
downloadranksvm-f2d01e30f459818f0589e06839d38999aecfdc06.tar.gz
ranksvm-f2d01e30f459818f0589e06839d38999aecfdc06.tar.bz2
ranksvm-f2d01e30f459818f0589e06839d38999aecfdc06.zip
scaffolding
Diffstat (limited to 'model')
-rw-r--r--model/ranksvm.h6
-rw-r--r--model/ranksvmtn.cpp12
-rw-r--r--model/ranksvmtn.h5
3 files changed, 18 insertions, 5 deletions
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