source: trunk/lib/classifier/ConsensusInputRanker.h @ 451

Last change on this file since 451 was 451, checked in by Peter, 16 years ago

directory svm -> classifier

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.9 KB
Line 
1// $Id: ConsensusInputRanker.h 451 2005-12-15 21:09:12Z peter $
2
3#ifndef _theplu_classifier_consensusinputranker_
4#define _theplu_classifier_consensusinputranker_
5
6#include <c++_tools/classifier/InputRanker.h>
7
8namespace theplu {
9  class gslapi::matrix;
10  class gslapi::vector;
11  class statistics::Score;
12namespace classifier { 
13
14  ///
15  /// Class for ranking rows in a data matrix versus a target vector
16  /// in a cross validation manner. The rows are sorted with respect
17  /// to median of their ranks.
18  ///   
19  class ConsensusInputRanker
20  {
21 
22  public:
23    ///
24    /// Constructor taking \a data, \a target, Score object. The
25    /// constructor creates ranklists in a \a k fold crossvalidation
26    /// manner, and in total there is \a n times \a k ranklists.
27    ///
28    ConsensusInputRanker(const gslapi::matrix& data, 
29                         const gslapi::vector& target, 
30                         statistics::Score&,
31                         const size_t n = 1 ,
32                         const size_t k = 3 );
33
34    ///
35    /// Constructor taking \a data, \a target, \a weight and Score object. The
36    /// constructor creates ranklists in a \a k fold crossvalidation
37    /// manner, and in total there is \a n times \a k ranklists.
38    ///
39    ConsensusInputRanker(const gslapi::matrix& data, 
40                         const gslapi::vector& target,
41                         const gslapi::matrix& weight, 
42                         statistics::Score&,
43                         const size_t n = 1 ,
44                         const size_t k = 3 );
45
46    ///
47    /// Highest ranked row is ranked as number zero @return index of
48    /// row ranked as number \a i
49    ///
50    inline size_t id(const size_t i) const {return id_[i];}
51   
52    ///
53    /// Highest ranked row is ranked as number zero @return rank for
54    /// row \a i
55    ///
56    inline size_t rank(const size_t i) const {return rank_[i];}
57
58
59  private:
60    std::vector<size_t> id_;
61    std::vector<InputRanker> input_rankers_;
62    size_t k_;
63    size_t nof_rankers_;
64    std::vector<size_t> rank_;
65  };
66
67}} // of namespace classifier and namespace theplu
68
69#endif
70
Note: See TracBrowser for help on using the repository browser.