source: trunk/src/ConsensusInputRanker.h @ 133

Last change on this file since 133 was 133, checked in by Peter, 18 years ago

added sorting

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.2 KB
Line 
1// $Id: ConsensusInputRanker.h 133 2004-08-16 12:01:15Z peter $
2
3#ifndef _theplu_cpptools_consensusinputranker_
4#define _theplu_cpptools_consensusinputranker_
5
6// C++ tools include
7/////////////////////
8#include "InputRanker.h"
9#include "matrix.h"
10#include "Score.h"
11#include "vector.h"
12
13// Standard C++ includes
14////////////////////////
15
16
17namespace theplu {
18namespace cpptools { 
19
20  ///
21  /// Class for ranking rows in a data matrix versus a target vector
22  /// in a cross validation manner. The rows are sorted with respect
23  /// to median of their ranks.
24  ///   
25  class ConsensusInputRanker
26  {
27 
28  public:
29    ///
30    /// Constructor taking \a data, \a target, Score object
31    ///
32    ConsensusInputRanker(const gslapi::matrix& data, 
33                         const gslapi::vector& target, 
34                         Score&,
35                         const size_t = 1,
36                         const size_t = 3);
37
38    ///
39    /// @return id of input ranked as number \a i
40    ///
41    inline size_t id(const size_t i) const {return id_[i];}
42   
43    ///
44    /// @return rank for id \a i
45    ///
46    inline size_t rank(const size_t i) const {return rank_[i];}
47
48
49  private:
50    std::vector<size_t> id_;
51    std::vector<InputRanker> input_rankers_;
52    size_t k_;
53    size_t nof_rankers_;
54    std::vector<size_t> rank_;
55  };
56
57}} // of namespace cpptools and namespace theplu
58
59#endif
60
Note: See TracBrowser for help on using the repository browser.