source: trunk/c++_tools/classifier/ConsensusInputRanker.h @ 575

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

added function to add InputRanker? to ConsensusInputRanker?

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.6 KB
Line 
1// $Id: ConsensusInputRanker.h 522 2006-02-23 08:46:13Z 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 CrossSplitter;
13
14  ///
15  /// Class for ranking rows in a data matrix versus a target vector.
16  /// The rows are sorted with respect
17  /// to median of their ranks.
18  ///   
19  class ConsensusInputRanker
20  {
21 
22  public:
23    ///
24    /// @brief Default constructor
25    ///
26    ConsensusInputRanker(void);
27   
28    ///
29    /// Constructor
30    /// @todo doc
31    ConsensusInputRanker(CrossSplitter&, statistics::Score&);
32   
33    ///
34    /// @brief add an InputRanker
35    ///
36    /// @note update() must be called to make the added InputRanker to
37    /// influence consensus ids and ranks. If a sequence of
38    /// InputRankers are added, update() need to be called only after
39    /// the last InputRanker is added.
40    ///
41    inline void add(const InputRanker& ir) { input_rankers_.push_back(ir); }
42   
43    ///
44    /// Row with lowest rank (highest score) is ranked as number zero
45    /// @return index of row ranked as number \a i
46    ///
47    inline size_t id(const size_t i) const { return id_[i]; }
48   
49    ///
50    /// Row with lowest rank (highest score) is ranked as number zero
51    /// @return rank for row \a i
52    ///
53    inline size_t rank(const size_t i) const { return rank_[i]; }
54   
55    ///
56    /// update ids and ranks
57    ///
58    void update(void);
59
60
61  private:
62
63    std::vector<size_t> id_;
64    std::vector<InputRanker> input_rankers_;
65    std::vector<size_t> rank_;
66
67  };
68
69}} // of namespace classifier and namespace theplu
70
71#endif
72
Note: See TracBrowser for help on using the repository browser.