1 #ifndef _theplu_yat_classifier_target_
2 #define _theplu_yat_classifier_target_
29 #include "yat/utility/Exception.h"
42 namespace classifier {
64 Target(
const std::vector<std::string>& labels,
const Target&);
69 Target(std::istream&,
char sep=
'\0')
89 const std::map<std::string,size_t>&
classes(
void)
const;
111 bool binary(
size_t i)
const;
120 const std::vector<std::string>&
labels(
void);
140 size_t size(
void)
const;
145 size_t size(
const std::string& label)
const;
150 size_t size(
size_t cl)
const;
164 size_t operator[](
size_t sample)
const YAT_DEPRECATE;
177 std::vector<char> binary_;
178 std::vector<size_t> classes_;
180 std::map<std::string,size_t> class_map_;
181 std::vector<std::string> labels_;
183 void init(
const std::vector<std::string>&);
192 std::ostream& operator<<(std::ostream&,
const Target& );
const std::vector< std::string > & labels(void)
Class for containing sample labels.
Definition: Target.h:47
size_t operator[](size_t sample) const
size_t operator()(size_t sample) const
Class for storing indices of, e.g., a MatrixLookup.
Definition: Index.h:41
bool binary(size_t i) const
Default binary is set to false for all classes except class 0.
const Target & operator=(const Target &)
assignment operator
Class to report errors associated with IO operations.
Definition: Exception.h:109
void set_binary(size_t i, bool b)
Target(void)
default constructor
void random_shuffle(void)
randomize labels
size_t nof_classes(void) const
const std::map< std::string, size_t > & classes(void) const