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

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

docs

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