yat  0.21pre
ConsensusInputRanker.h
1 #ifndef _theplu_yat_classifier_consensusinputranker_
2 #define _theplu_yat_classifier_consensusinputranker_
3 
4 // $Id: ConsensusInputRanker.h 4207 2022-08-26 04:36:28Z peter $
5 
6 /*
7  Copyright (C) 2004, 2005 Peter Johansson
8  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
9  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
10  Copyright (C) 2022 Peter Johansson
11 
12  This file is part of the yat library, http://dev.thep.lu.se/yat
13 
14  The yat library is free software; you can redistribute it and/or
15  modify it under the terms of the GNU General Public License as
16  published by the Free Software Foundation; either version 3 of the
17  License, or (at your option) any later version.
18 
19  The yat library is distributed in the hope that it will be useful,
20  but WITHOUT ANY WARRANTY; without even the implied warranty of
21  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
22  General Public License for more details.
23 
24  You should have received a copy of the GNU General Public License
25  along with yat. If not, see <http://www.gnu.org/licenses/>.
26 */
27 
28 #include "InputRanker.h"
29 
30 #include <vector>
31 
32 namespace theplu {
33 namespace yat {
34 namespace statistics {
35  class Score;
36  class VectorFunction;
37 }
38 namespace classifier {
39 
40  class IRRetrieve;
41  class MatrixLookup;
42  class MatrixLookupWeighted;
43  class Sampler;
44 
69  {
70 
71  public:
72 
79 
86  void add(const Sampler& sampler, const MatrixLookup&,
87  const statistics::Score& s);
88 
97  void add(const Sampler& sampler, const MatrixLookupWeighted& data,
98  const statistics::Score& score);
99 
108  void add(const InputRanker& ir);
109 
114  size_t id(size_t i) const;
115 
119  const InputRanker& input_ranker(size_t i) const;
120 
125  size_t rank(size_t i) const;
126 
133  void reserve(size_t n);
134 
135 
139  void update(void);
140 
141 
142  private:
143 
144  std::vector<size_t> id_;
145  std::vector<InputRanker> input_rankers_;
146  std::vector<size_t> rank_;
147  const IRRetrieve& retriever_;
148  const statistics::VectorFunction& vec_func_;
149  };
150 
151 }}} // of namespace classifier, yat, and theplu
152 
153 #endif
General view into utility::Matrix.
Definition: MatrixLookup.h:70
The Department of Theoretical Physics namespace as we define it.
ConsensusInputRanker(const IRRetrieve &, const statistics::VectorFunction &)
Default constructor.
General view into utility::MatrixWeighted.
Definition: MatrixLookupWeighted.h:63
const InputRanker & input_ranker(size_t i) const
Interface Class for score classes.
Definition: Score.h:43
Robust algorithm to rank rows in a data matrix versus a target vector.
Definition: ConsensusInputRanker.h:68
void add(const Sampler &sampler, const MatrixLookup &, const statistics::Score &s)
Interface class for dividing samples into training and validation.
Definition: Sampler.h:40
Class for ranking rows in a matrix, using a Score and a target vector.
Definition: InputRanker.h:46
Interface class for retrieving information from a InputRanker to build a ConsensusInputRanker.
Definition: IRRetrieve.h:36
Interface Class for vector functors.
Definition: VectorFunction.h:37
void reserve(size_t n)
reserve memory for internal vector of InputRankers

Generated on Wed Jan 25 2023 03:34:29 for yat by  doxygen 1.8.14