source: branches/peters_vector/lib/classifier/ConsensusInputRanker.h @ 470

Last change on this file since 470 was 470, checked in by Peter, 17 years ago

compiling 3 tests fail

  • 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 470 2005-12-19 19:46:50Z 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 statistics::Score;
10namespace classifier { 
11
12  class CrossSplitting;
13  class MatrixLookup;
14  class Target;
15
16  ///
17  /// Class for ranking rows in a data matrix versus a target vector
18  /// in a cross validation manner. The rows are sorted with respect
19  /// to median of their ranks.
20  ///   
21  class ConsensusInputRanker
22  {
23 
24  public:
25    ///
26    /// Constructor taking \a data, \a target, Score object. The
27    /// constructor creates ranklists in a \a k fold crossvalidation
28    /// manner, and in total there is \a n times \a k ranklists.
29    ///
30    ConsensusInputRanker(const MatrixLookup& data, 
31                         const Target& target, 
32                         statistics::Score&, 
33                         CrossSplitting&,
34                         const size_t n);
35
36    ///
37    /// Constructor taking \a data, \a target, \a weight and Score object. The
38    /// constructor creates ranklists in a \a k fold crossvalidation
39    /// manner, and in total there is \a n times \a k ranklists.
40    ///
41    ConsensusInputRanker(const MatrixLookup& data, 
42                         const Target& target, 
43                         const MatrixLookup& weight, 
44                         statistics::Score&, 
45                         CrossSplitting&,
46                         const size_t n);
47
48    ///
49    /// Highest ranked row is ranked as number zero @return index of
50    /// row ranked as number \a i
51    ///
52    inline size_t id(const size_t i) const {return id_[i];}
53   
54    ///
55    /// Highest ranked row is ranked as number zero @return rank for
56    /// row \a i
57    ///
58    inline size_t rank(const size_t i) const {return rank_[i];}
59
60
61  private:
62    std::vector<size_t> id_;
63    std::vector<InputRanker> input_rankers_;
64    u_int nof_rankers_;
65    std::vector<size_t> rank_;
66  };
67
68}} // of namespace classifier and namespace theplu
69
70#endif
71
Note: See TracBrowser for help on using the repository browser.