Last change
on this file since 89 was
89,
checked in by Peter, 19 years ago
|
InputRanker? added
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Author Date Id Revision
|
File size:
1.1 KB
|
Line | |
---|
1 | // $Id: InputRanker.h 89 2004-05-28 17:44:42Z peter $ |
---|
2 | |
---|
3 | #ifndef _theplu_cpptools_inputranker_ |
---|
4 | #define _theplu_cpptools_inputranker_ |
---|
5 | |
---|
6 | // C++ tools include |
---|
7 | ///////////////////// |
---|
8 | #include "vector.h" |
---|
9 | #include "matrix.h" |
---|
10 | |
---|
11 | // Standard C++ includes |
---|
12 | //////////////////////// |
---|
13 | |
---|
14 | |
---|
15 | namespace theplu { |
---|
16 | namespace cpptools { |
---|
17 | /// |
---|
18 | /// Class for ranking the columns in a matrix, using ROC (this could |
---|
19 | /// and the target vector. |
---|
20 | /// |
---|
21 | class InputRanker |
---|
22 | { |
---|
23 | |
---|
24 | public: |
---|
25 | /// |
---|
26 | /// Constructor taking data, target and vector defining what |
---|
27 | /// samples to use (default is to use all samples) |
---|
28 | /// |
---|
29 | InputRanker(const gslapi::matrix&, const gslapi::vector&, |
---|
30 | const std::vector<size_t> = std::vector<size_t>()); |
---|
31 | |
---|
32 | /// |
---|
33 | /// @return id of input ranked as number i |
---|
34 | /// |
---|
35 | inline size_t id(const size_t i) const {return id_[i];} |
---|
36 | |
---|
37 | /// |
---|
38 | /// @return rank for id i |
---|
39 | /// |
---|
40 | inline size_t rank(const size_t i) const {return rank_[i];} |
---|
41 | |
---|
42 | |
---|
43 | private: |
---|
44 | std::vector<size_t> train_set_; |
---|
45 | std::vector<size_t> id_; |
---|
46 | std::vector<size_t> rank_; |
---|
47 | |
---|
48 | |
---|
49 | }; |
---|
50 | |
---|
51 | }} // of namespace cpptools and namespace theplu |
---|
52 | |
---|
53 | #endif |
---|
54 | |
---|
Note: See
TracBrowser
for help on using the repository browser.