Class for containing sample labels.
More...
#include <yat/classifier/Target.h>
|
(Note that these are not member functions.)
|
std::ostream & | operator<< (std::ostream &, const Target &) |
|
Class for containing sample labels.
◆ Target()
Constructor creating a sub-Target from Target org. vec defines which indices to use.
- Note
- class is preserved, i.e., operator() returns the same for the Target as the original Target.
◆ binary()
bool theplu::yat::classifier::Target::binary |
( |
size_t |
i | ) |
const |
Default binary is set to false for all classes except class 0.
- Returns
- binary target for sample i
- See also
- set_binary
◆ classes()
const std::map<std::string,size_t>& theplu::yat::classifier::Target::classes |
( |
void |
| ) |
const |
- Returns
- a map with label as key and class as value.
◆ labels()
const std::vector<std::string>& theplu::yat::classifier::Target::labels |
( |
void |
| ) |
const |
The size of returned vector is equal to number of classes. To get label of sample i you need to call target.labels()[target(i)]
- Returns
- vector of labels for classes
◆ nof_classes()
size_t theplu::yat::classifier::Target::nof_classes |
( |
void |
| ) |
const |
◆ operator()()
size_t theplu::yat::classifier::Target::operator() |
( |
size_t |
sample | ) |
const |
- Returns
- the class of sample
◆ operator[]()
size_t theplu::yat::classifier::Target::operator[] |
( |
size_t |
sample | ) |
const |
- Returns
- the class of sample
- Deprecated:
- Provided for backward compatibility with the 0.4 API. Use operator().
◆ random_shuffle()
void theplu::yat::classifier::Target::random_shuffle |
( |
void |
| ) |
|
randomize labels
Randomizes classes. Number of samples with a specific label is not modified, neither mapping from label to class.
◆ set_binary()
void theplu::yat::classifier::Target::set_binary |
( |
size_t |
i, |
|
|
bool |
b |
|
) |
| |
Binary target for each sample with class i is set to b. Default is binary set to false for each class except class 0 which is set to true.
◆ size() [1/3]
size_t theplu::yat::classifier::Target::size |
( |
void |
| ) |
const |
◆ size() [2/3]
size_t theplu::yat::classifier::Target::size |
( |
const std::string & |
label | ) |
const |
- Returns
- number of samples with label label
◆ size() [3/3]
size_t theplu::yat::classifier::Target::size |
( |
size_t |
cl | ) |
const |
- Returns
- number of samples with class cl
◆ operator<<()
std::ostream & operator<< |
( |
std::ostream & |
, |
|
|
const Target & |
|
|
) |
| |
|
related |
The output operator for the Target class.
The documentation for this class was generated from the following file: