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

Last change on this file since 1797 was 1797, checked in by Peter, 13 years ago

updating copyright statements

  • 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) 2004 Peter Johansson
8  Copyright (C) 2005, 2006, 2007, 2008 Jari Häkkinen, Peter Johansson
9
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24*/
25
26#include <vector>
27
28namespace theplu {
29namespace yat {
30namespace statistics {
31  class Score;
32}
33namespace classifier { 
34
35  class MatrixLookup;
36  class MatrixLookupWeighted;
37  class Target;
38
39  ///
40  /// @brief Class for ranking rows in a matrix, using a Score and a
41  /// target vector.
42  ///   
43  class InputRanker
44  {
45
46  public:
47    ///
48    /// Constructor taking data, target, a Score
49    /// object and vector defining what samples to use (default is to
50    /// use all samples)
51    ///
52    InputRanker(const MatrixLookup&, const Target&, const statistics::Score&); 
53
54    ///
55    /// Constructor taking data, target, a Score
56    /// object and vector defining what samples to use (default is to
57    /// use all samples)
58    ///
59    InputRanker(const MatrixLookupWeighted&, const Target&, 
60                const statistics::Score&); 
61
62    ///
63    /// highest ranked gene is ranked as number zero @return id
64    /// (index) of input ranked as number \a i
65    ///
66    const std::vector<size_t>& id(void) const;
67
68    ///
69    /// highest ranked gene is ranked as number zero @return rank for
70    /// id (row) \a i
71    ///
72    const std::vector<size_t>& rank(void) const;
73
74    ///
75    /// @param rank should be a number in range [0,N-1] where N is number
76    /// of inputs in data matrix. "score(0)" will gives the score of
77    /// the feature that had the highest score.
78    ///
79    /// @return score of the input that has been been ranked as
80    /// number @a rank.
81    ///
82    double score(size_t rank) const;
83
84  private:
85    std::vector<size_t> id_;
86    std::vector<size_t> rank_;
87    std::vector<double> score_;
88  };
89
90
91}}} // of namespace classifier, yat, and theplu
92
93#endif
Note: See TracBrowser for help on using the repository browser.