diff options
Diffstat (limited to 'model/ranksvmtn.cpp')
-rw-r--r-- | model/ranksvmtn.cpp | 13 |
1 files changed, 7 insertions, 6 deletions
diff --git a/model/ranksvmtn.cpp b/model/ranksvmtn.cpp index 3c9808b..821d231 100644 --- a/model/ranksvmtn.cpp +++ b/model/ranksvmtn.cpp @@ -1,5 +1,6 @@ #include "ranksvmtn.h" #include<iostream> +#include<list> #include"../tools/matrixIO.h" using namespace std; @@ -78,8 +79,8 @@ int line_search(const VectorXd &w,const MatrixXd &D,const MatrixXd &A,const Vect return 0; } -int RSVMTN::train(DataSet &D, Labels &label){ - int iter = 0; +int RSVMTN::train(DataList &D){ + /*int iter = 0; double C=1; MatrixXd A; @@ -121,13 +122,13 @@ int RSVMTN::train(DataSet &D, Labels &label){ // When dec is small enough if (-step.dot(grad) < prec * obj) break; - } + }*/ return 0; }; -int RSVMTN::predict(DataSet &D, Labels &res){ +int RSVMTN::predict(DataList &D, list<double> &res){ //TODO define A - MatrixXd A; - res = A*(D * model.weight); + for (list<DataEntry*>::iterator i=D.getData().begin(), end=D.getData().end();i!=end;++i) + res.push_back(((*i)->feature).dot(model.weight)); return 0; };
\ No newline at end of file |