yat  0.16pre
Sampler.h
1 #ifndef _theplu_yat_classifier_sampler_
2 #define _theplu_yat_classifier_sampler_
3 
4 // $Id: Sampler.h 2608 2011-11-01 02:47:32Z peter $
5 
6 /*
7  Copyright (C) 2006 Jari Häkkinen, Peter Johansson, Markus Ringnér
8  Copyright (C) 2007, 2008 Jari Häkkinen, Peter Johansson
9 
10  This file is part of the yat library, http://dev.thep.lu.se/yat
11 
12  The yat library is free software; you can redistribute it and/or
13  modify it under the terms of the GNU General Public License as
14  published by the Free Software Foundation; either version 3 of the
15  License, or (at your option) any later version.
16 
17  The yat library is distributed in the hope that it will be useful,
18  but WITHOUT ANY WARRANTY; without even the implied warranty of
19  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
20  General Public License for more details.
21 
22  You should have received a copy of the GNU General Public License
23  along with yat. If not, see <http://www.gnu.org/licenses/>.
24 */
25 
26 #include "Target.h"
27 #include "yat/utility/Index.h"
28 
29 #include <vector>
30 
31 namespace theplu {
32 namespace yat {
33 namespace classifier {
34 
39  class Sampler
40  {
41 
42  public:
49  Sampler(const Target& target, size_t N);
50 
54  virtual ~Sampler() =0;
55 
59  size_t size(void) const;
60 
64  const Target& target(void) const;
65 
69  const utility::Index&
70  training_index(size_t i) const;
71 
77  const Target& training_target(size_t i) const;
78 
84  const utility::Index& validation_index(size_t i) const;
85 
91  const Target& validation_target(size_t i) const;
92 
93  protected:
95  std::vector<utility::Index> training_index_;
97  std::vector<Target> training_target_;
99  std::vector<utility::Index> validation_index_;
101  std::vector<Target> validation_target_;
102 
103  private:
104  Target target_;
105  };
106 
107 }}} // of namespace classifier, yat, and theplu
108 #endif
const Target & training_target(size_t i) const
std::vector< utility::Index > validation_index_
index of validation sets for the partitions
Definition: Sampler.h:99
Class for containing sample labels.
Definition: Target.h:47
The Department of Theoretical Physics namespace as we define it.
Sampler(const Target &target, size_t N)
Constructor.
std::vector< Target > validation_target_
Targets for validation sets for the partitions.
Definition: Sampler.h:101
Class for storing indices of, e.g., a MatrixLookup.
Definition: Index.h:41
std::vector< Target > training_target_
Targets for training sets for the partitions.
Definition: Sampler.h:97
const utility::Index & training_index(size_t i) const
std::vector< utility::Index > training_index_
index of training sets for the partitions
Definition: Sampler.h:95
Interface class for dividing samples into training and validation.
Definition: Sampler.h:39
const Target & target(void) const
const utility::Index & validation_index(size_t i) const
const Target & validation_target(size_t i) const

Generated on Wed Jan 30 2019 02:34:17 for yat by  doxygen 1.8.11