From f2d01e30f459818f0589e06839d38999aecfdc06 Mon Sep 17 00:00:00 2001 From: Joe Zhao Date: Sun, 8 Mar 2015 17:47:33 +0800 Subject: scaffolding --- tools/dataProvider.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'tools/dataProvider.h') diff --git a/tools/dataProvider.h b/tools/dataProvider.h index d9440ce..0e6ed9e 100644 --- a/tools/dataProvider.h +++ b/tools/dataProvider.h @@ -3,8 +3,21 @@ #include #include "../tools/easylogging++.h" +#include // TODO decide how to construct training data +// One possible way for training data: +// Matrix composed of an array of feature vectors +// Labels are composed of linked list, such as +// 6,3,4,0,5,0,0 +// => 0->6 | 1->3 | 2->4->5 +// How to compensate for non exhaustive labeling? +// Use -1 to indicate not yet labeled data +// -1s will be excluded from training + +typedef Eigen::MatrixXd DataSet; + +typedef std::vector Labels; class DataProvider //Virtual base class for data input { @@ -19,8 +32,8 @@ public: return attrSize; } - virtual Eigen::MatrixXd* getAttr() = 0; - virtual Eigen::VectorXd* getPref() = 0; + virtual int getDataSet(DataSet &out) = 0; + virtual int getLabel(Labels &out) = 0; virtual int open()=0; virtual bool EOFile()=0; }; -- cgit v1.2.3-70-g09d2