source: trunk/src/InputRanker.h @ 108

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

modified the interface to be able to use any Score object

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.1 KB
Line 
1// $Id: InputRanker.h 108 2004-06-16 13:08:09Z peter $
2
3#ifndef _theplu_cpptools_inputranker_
4#define _theplu_cpptools_inputranker_
5
6// C++ tools include
7/////////////////////
8#include "vector.h"
9#include "matrix.h"
10#include "Score.h"
11
12// Standard C++ includes
13////////////////////////
14
15
16namespace theplu {
17namespace cpptools { 
18  ///
19  /// Class for ranking the columns in a matrix, using a Score and a
20  /// target vector.
21  ///   
22  class InputRanker
23  {
24 
25  public:
26    ///
27    /// Constructor taking data, target, pointer to a Score
28    /// object and vector defining what samples to use (default is to
29    /// use all samples)
30    ///
31    InputRanker(const gslapi::matrix&, 
32                const gslapi::vector&, 
33                Score&, 
34                const std::vector<size_t>& = std::vector<size_t>());
35
36    ///
37    /// @return id of input ranked as number i
38    ///
39    inline size_t id(const size_t i) const {return id_[i];}
40   
41    ///
42    /// @return rank for id i
43    ///
44    inline size_t rank(const size_t i) const {return rank_[i];}
45
46
47  private:
48    std::vector<size_t> train_set_;
49    std::vector<size_t> id_;
50    std::vector<size_t> rank_;
51
52         
53  };
54
55}} // of namespace cpptools and namespace theplu
56
57#endif
58
Note: See TracBrowser for help on using the repository browser.