source: trunk/lib/classifier/InputRanker.h @ 482

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

modified interface to CrossSplitter?, added functions to DataLookup2D
that extracts trainingdata and validation data. For the time being
weights are not supported in CrossSplitter?.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date Id Revision
File size: 1.4 KB
Line 
1// $Id: InputRanker.h 482 2006-01-02 19:10:10Z peter $
2
3#ifndef _theplu_classifier_inputranker_
4#define _theplu_classifier_inputranker_
5
6#include <vector>
7
8namespace theplu {
9namespace gslapi {
10  class matrix;
11  class vector;
12}
13namespace statistics {
14  class Score;
15}
16namespace classifier { 
17
18  class DataLookup2D;
19  class MatrixLookup;
20  class Target;
21
22  ///
23  /// Class for ranking rows in a matrix, using a Score and a
24  /// target vector.
25  ///   
26  class InputRanker
27  {
28
29  public:
30    ///
31    /// Constructor taking data, target, a Score
32    /// object and vector defining what samples to use (default is to
33    /// use all samples)
34    ///
35    InputRanker(const DataLookup2D&, const Target&, statistics::Score&); 
36
37
38    ///
39    /// Constructor taking data, target, weight, pointer to a Score
40    /// object and vector defining what samples to use (default is to
41    /// use all samples)
42    ///
43    InputRanker(const DataLookup2D&, const Target&, statistics::Score&, 
44                const MatrixLookup&); 
45
46
47    ///
48    /// highest ranked gene is ranked as number zero @return id
49    /// (index) of input ranked as number \a i
50    ///
51    inline size_t id(const size_t i) const {return id_[i];}
52
53    ///
54    /// highest ranked gene is ranked as number zero @return rank for
55    /// id (column) \a i
56    ///
57    inline size_t rank(const size_t i) const {return rank_[i];}
58
59
60  private:
61    std::vector<size_t> id_;
62    std::vector<size_t> rank_;
63  };
64
65
66}} // of namespace classifier and namespace theplu
67
68#endif
Note: See TracBrowser for help on using the repository browser.