summaryrefslogtreecommitdiff
path: root/model/ranksvm.h
blob: 5217b567cef409bce30b40ee09998fa2a4737b08 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
#ifndef RANKSVM_H
#define RANKSVM_H

#include<Eigen/Dense>
#include<string>
#include"../tools/dataProvider.h"
#include "../tools/easylogging++.h"

class RSVM  //Virtual base class for all RSVM operations
{
protected:
    Eigen::VectorXd model;
    int fsize;
public:
    virtual int train(DataSet &D, Labels &label)=0;
    virtual int predict(DataSet &D, Labels &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;
    Eigen::MatrixXd getModel(){
        return model;};
    int setModel(const Labels &model);
};

#endif