yat  0.21pre
Sampler.h
1 #ifndef _theplu_yat_classifier_sampler_
2 #define _theplu_yat_classifier_sampler_
3 
4 // $Id: Sampler.h 4207 2022-08-26 04:36:28Z 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  Copyright (C) 2022 Peter Johansson
10 
11  This file is part of the yat library, http://dev.thep.lu.se/yat
12 
13  The yat library is free software; you can redistribute it and/or
14  modify it under the terms of the GNU General Public License as
15  published by the Free Software Foundation; either version 3 of the
16  License, or (at your option) any later version.
17 
18  The yat library is distributed in the hope that it will be useful,
19  but WITHOUT ANY WARRANTY; without even the implied warranty of
20  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
21  General Public License for more details.
22 
23  You should have received a copy of the GNU General Public License
24  along with yat. If not, see <http://www.gnu.org/licenses/>.
25 */
26 
27 #include "Target.h"
28 #include "yat/utility/Index.h"
29 
30 #include <vector>
31 
32 namespace theplu {
33 namespace yat {
34 namespace classifier {
35 
40  class Sampler
41  {
42 
43  public:
50  Sampler(const Target& target, size_t N);
51 
55  virtual ~Sampler() =0;
56 
60  size_t size(void) const;
61 
65  const Target& target(void) const;
66 
70  const utility::Index&
71  training_index(size_t i) const;
72 
78  const Target& training_target(size_t i) const;
79 
85  const utility::Index& validation_index(size_t i) const;
86 
92  const Target& validation_target(size_t i) const;
93 
94  protected:
96  std::vector<utility::Index> training_index_;
98  std::vector<Target> training_target_;
100  std::vector<utility::Index> validation_index_;
102  std::vector<Target> validation_target_;
103 
104  private:
105  Target target_;
106  };
107 
108 }}} // of namespace classifier, yat, and theplu
109 #endif
std::vector< utility::Index > validation_index_
index of validation sets for the partitions
Definition: Sampler.h:100
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.
const Target & target(void) const
const Target & validation_target(size_t i) const
std::vector< Target > validation_target_
Targets for validation sets for the partitions.
Definition: Sampler.h:102
Class for storing indices of, e.g., a MatrixLookup.
Definition: Index.h:41
const utility::Index & training_index(size_t i) const
std::vector< Target > training_target_
Targets for training sets for the partitions.
Definition: Sampler.h:98
std::vector< utility::Index > training_index_
index of training sets for the partitions
Definition: Sampler.h:96
Interface class for dividing samples into training and validation.
Definition: Sampler.h:40
const utility::Index & validation_index(size_t i) const
const Target & training_target(size_t i) const

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