source: trunk/yat/classifier/InputRanker.h @ 720

Last change on this file since 720 was 720, checked in by Jari Häkkinen, 16 years ago

Fixes #170. Almost all inlines removed, some classes have no cc file.

  • Property svn:eol-style set to native
  • Property svn:keywords set to Author Date ID
File size: 2.5 KB
Line 
1#ifndef _theplu_yat_classifier_inputranker_
2#define _theplu_yat_classifier_inputranker_
3
4// $Id$
5
6/*
7  Copyright (C) The authors contributing to this file.
8
9  This file is part of the yat library, http://lev.thep.lu.se/trac/yat
10
11  The yat library is free software; you can redistribute it and/or
12  modify it under the terms of the GNU General Public License as
13  published by the Free Software Foundation; either version 2 of the
14  License, or (at your option) any later version.
15
16  The yat library is distributed in the hope that it will be useful,
17  but WITHOUT ANY WARRANTY; without even the implied warranty of
18  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
19  General Public License for more details.
20
21  You should have received a copy of the GNU General Public License
22  along with this program; if not, write to the Free Software
23  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA
24  02111-1307, USA.
25*/
26
27#include <vector>
28
29namespace theplu {
30namespace yat {
31namespace statistics {
32  class Score;
33}
34namespace classifier { 
35
36  class DataLookup2D;
37  class MatrixLookup;
38  class MatrixLookupWeighted;
39  class Target;
40
41  ///
42  /// Class for ranking rows in a matrix, using a Score and a
43  /// target vector.
44  ///   
45  class InputRanker
46  {
47
48  public:
49    ///
50    /// Constructor taking data, target, a Score
51    /// object and vector defining what samples to use (default is to
52    /// use all samples)
53    ///
54    InputRanker(const MatrixLookup&, const Target&, statistics::Score&); 
55
56    ///
57    /// Constructor taking data, target, a Score
58    /// object and vector defining what samples to use (default is to
59    /// use all samples)
60    ///
61    InputRanker(const MatrixLookupWeighted&, const Target&, 
62                statistics::Score&); 
63
64    ///
65    /// highest ranked gene is ranked as number zero @return id
66    /// (index) of input ranked as number \a i
67    ///
68    const std::vector<size_t>& id(void) const;
69
70    ///
71    /// highest ranked gene is ranked as number zero @return rank for
72    /// id (row) \a i
73    ///
74    const std::vector<size_t>& rank(void) const;
75
76    ///
77    /// @param should be a number in range [0,N-1] where N is number
78    /// of inputs in data matrix. "score(0)" will gives the score of
79    /// the feature that had the highest score.
80    ///
81    /// @return score of the input that have been been ranked as
82    /// number @a rank.
83    ///
84    double score(size_t rank) const;
85
86  private:
87    std::vector<size_t> id_;
88    std::vector<size_t> rank_;
89    std::vector<double> score_;
90  };
91
92
93}}} // of namespace classifier, yat, and theplu
94
95#endif
Note: See TracBrowser for help on using the repository browser.