Fix replication for files > 4GB on 32-bit platforms
[xapian.git] / xapian-letor / svmranker.cc
blobe36ec3d4ac7b1d10a0965f7a5e238de88ade96ed
1 /* ranker.h: The abstract ranker file.
3 * Copyright (C) 2012 Parth Gupta
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License as
7 * published by the Free Software Foundation; either version 2 of the
8 * License, or (at your option) any later version.
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
18 * USA
21 #ifndef SVMRANKER_H
22 #define SVMRANKER_H
25 #include <xapian.h>
26 #include <xapian/base.h>
27 #include <xapian/types.h>
28 #include <xapian/visibility.h>
30 #include "ranker.h"
31 #include "ranklist.h"
32 //#include "evalmetric.h"
34 #include <list>
35 #include <map>
37 using namespace std;
40 namespace Xapian {
42 class XAPIAN_VISIBILITY_DEFAULT SVMRanker: public Ranker {
44 string model = null;
45 double[] weight;
46 public:
47 SVMRanker() {};
49 /* Override all the four methods below in the ranker sub-classes files
50 * wiz svmranker.cc , listnet.cc, listmle.cc and so on
52 Xapian::RankList rank(const Xapian::RankList & rl);
54 void learn_model();
56 void load_model(const std::string & model_file);
58 void save_model();
60 double score(const Xapian::FeatureVector & fv);
65 #endif /* SVMRANKER_H */