summaryrefslogtreecommitdiff
path: root/model/ranksvm.h
blob: e7b7c4ab97d156a3b2d428659eec15f5fb8b6f80 (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
#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(DataProvider &D)=0; // Dataprovider will have to provide label
    virtual int predict(DataProvider &D)=0;  // TODO Not sure how to construct this
    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 Eigen::VectorXd &model);
};

#endif