Last change
on this file since 469 was
469,
checked in by Peter, 17 years ago
|
non compiling checking before revision after design meeting
|
File size:
1.3 KB
|
Line | |
---|
1 | // $Id$ |
---|
2 | |
---|
3 | #ifndef _theplu_classifier_ncc_ |
---|
4 | #define _theplu_classifier_ncc_ |
---|
5 | |
---|
6 | #include <c++_tools/gslapi/matrix.h> |
---|
7 | |
---|
8 | #include <map> |
---|
9 | |
---|
10 | namespace theplu { |
---|
11 | namespace gslapi { |
---|
12 | class vector; |
---|
13 | } |
---|
14 | namespace statistics { |
---|
15 | class Score; |
---|
16 | } |
---|
17 | |
---|
18 | namespace classifier { |
---|
19 | |
---|
20 | class DataView; |
---|
21 | class Score; |
---|
22 | class Target; |
---|
23 | class VectorView; |
---|
24 | |
---|
25 | /// |
---|
26 | /// Class for Nearest Centroid Classification |
---|
27 | /// |
---|
28 | |
---|
29 | class NCC |
---|
30 | { |
---|
31 | |
---|
32 | public: |
---|
33 | /// |
---|
34 | /// Default constructor (not implemented) |
---|
35 | /// |
---|
36 | NCC(); |
---|
37 | |
---|
38 | /// |
---|
39 | /// Constructor taking the training data and the target vector as |
---|
40 | /// input. Performs the training of the NCC. |
---|
41 | /// |
---|
42 | NCC(const DataView&, const Target&); |
---|
43 | |
---|
44 | /// |
---|
45 | /// @todo Copy constructor. |
---|
46 | /// |
---|
47 | NCC(const NCC&); |
---|
48 | |
---|
49 | /// |
---|
50 | /// @todo The istream constructor. |
---|
51 | /// |
---|
52 | NCC(std::istream&); |
---|
53 | |
---|
54 | const gslapi::matrix& centroids(void) const {return centroids_;} |
---|
55 | |
---|
56 | const std::map<double,u_int>& classes(void) const {return classes_;} |
---|
57 | |
---|
58 | |
---|
59 | /// |
---|
60 | /// Calculate the scores to each centroid for a test sample |
---|
61 | /// |
---|
62 | void predict(const gslapi::vector&, statistics::Score&, |
---|
63 | gslapi::vector&); |
---|
64 | |
---|
65 | private: |
---|
66 | gslapi::matrix centroids_; |
---|
67 | std::map<double,u_int> classes_; |
---|
68 | }; |
---|
69 | |
---|
70 | /// |
---|
71 | /// The output operator for the NCC class. |
---|
72 | /// |
---|
73 | std::ostream& operator<< (std::ostream&, const NCC&); |
---|
74 | |
---|
75 | |
---|
76 | }} // of namespace classifier and namespace theplu |
---|
77 | |
---|
78 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.