Last change
on this file since 520 was
520,
checked in by Peter, 17 years ago
|
changed internal representation in Target
|
-
Property svn:eol-style set to
native
-
Property svn:keywords set to
Id
|
File size:
1.3 KB
|
Line | |
---|
1 | // $Id: EnsembleBuilder.h 520 2006-02-22 15:01:10Z peter $ |
---|
2 | |
---|
3 | #ifndef _theplu_classifier_ensemblebuilder_ |
---|
4 | #define _theplu_classifier_ensemblebuilder_ |
---|
5 | |
---|
6 | #include <c++_tools/statistics/Averager.h> |
---|
7 | |
---|
8 | #include <vector> |
---|
9 | |
---|
10 | namespace theplu { |
---|
11 | namespace classifier { |
---|
12 | |
---|
13 | class CrossSplitter; |
---|
14 | class DataLookup2D; |
---|
15 | class SupervisedClassifier; |
---|
16 | |
---|
17 | /// |
---|
18 | /// Class for ensembles of supervised classifiers |
---|
19 | /// |
---|
20 | |
---|
21 | class EnsembleBuilder |
---|
22 | { |
---|
23 | |
---|
24 | public: |
---|
25 | /// |
---|
26 | /// Constructor. |
---|
27 | /// |
---|
28 | EnsembleBuilder(const SupervisedClassifier&, CrossSplitter&); |
---|
29 | |
---|
30 | /// |
---|
31 | /// Destructor. |
---|
32 | /// |
---|
33 | virtual ~EnsembleBuilder(void); |
---|
34 | |
---|
35 | |
---|
36 | /// |
---|
37 | /// Generate ensemble. Function trains each member of the Ensemble. |
---|
38 | /// |
---|
39 | void build(void); |
---|
40 | |
---|
41 | /// |
---|
42 | /// @Return classifier |
---|
43 | /// |
---|
44 | inline const SupervisedClassifier& classifier(size_t i) const |
---|
45 | { |
---|
46 | return *(classifier_[i]); |
---|
47 | } |
---|
48 | |
---|
49 | /// |
---|
50 | /// @Return Number of classifiers in ensemble |
---|
51 | /// |
---|
52 | inline u_long size(void) const |
---|
53 | { |
---|
54 | return classifier_.size(); |
---|
55 | } |
---|
56 | |
---|
57 | /// |
---|
58 | /// Generate validation data for ensemble |
---|
59 | /// |
---|
60 | const std::vector<std::vector<statistics::Averager> >& validate(void); |
---|
61 | |
---|
62 | |
---|
63 | |
---|
64 | private: |
---|
65 | |
---|
66 | const SupervisedClassifier& mother_; |
---|
67 | CrossSplitter& cross_splitter_; |
---|
68 | std::vector<SupervisedClassifier*> classifier_; |
---|
69 | std::vector<std::vector<statistics::Averager> > validation_result_; |
---|
70 | |
---|
71 | }; |
---|
72 | |
---|
73 | }} // of namespace classifier and namespace theplu |
---|
74 | |
---|
75 | #endif |
---|
Note: See
TracBrowser
for help on using the repository browser.