|
SHOGUN v0.9.3
|
The class Labels models labels, i.e. class assignments of objects.
Labels here are always real-valued and thus applicable to classification (cf. CClassifier) and regression (cf. CRegression) problems.

Public Member Functions | |
| CLabels () | |
| CLabels (int32_t num_labels) | |
| CLabels (float64_t *src, int32_t len) | |
| CLabels (float64_t *in_confidences, int32_t in_num_labels, int32_t in_num_classes) | |
| CLabels (CFile *loader) | |
| virtual | ~CLabels () |
| virtual void | load (CFile *loader) |
| virtual void | save (CFile *writer) |
| bool | set_label (int32_t idx, float64_t label) |
| bool | set_int_label (int32_t idx, int32_t label) |
| float64_t | get_label (int32_t idx) |
| int32_t | get_int_label (int32_t idx) |
| bool | is_two_class_labeling () |
| int32_t | get_num_classes () |
| float64_t * | get_labels (int32_t &len) |
| void | get_labels (float64_t **dst, int32_t *len) |
| void | set_labels (float64_t *src, int32_t len) |
| void | set_confidences (float64_t *in_confidences, int32_t in_num_labels, int32_t in_num_classes) |
| float64_t * | get_confidences (int32_t &out_num_labels, int32_t &out_num_classes) |
| void | get_confidences (float64_t **dst, int32_t *out_num_labels, int32_t *out_num_classes) |
| float64_t * | get_sample_confidences (const int32_t &in_sample_index, int32_t &out_num_classes) |
| int32_t * | get_int_labels (int32_t &len) |
| void | set_int_labels (int32_t *labels, int32_t len) |
| int32_t | get_num_labels () |
| virtual const char * | get_name () const |
Protected Member Functions | |
| void | find_labels () |
Protected Attributes | |
| int32_t | num_labels |
| float64_t * | labels |
| int16_t | m_num_classes |
| float64_t * | m_confidences |
| CLabels | ( | ) |
default constructor
Definition at line 25 of file Labels.cpp.
| CLabels | ( | int32_t | num_labels | ) |
constructor
| src | labels to set |
| len | number of labels |
Definition at line 45 of file Labels.cpp.
constructor
| in_confidences | confidence matrix to be used to derive the labels |
| in_num_labels | number of labels |
| in_num_classes | number of classes |
Definition at line 59 of file Labels.cpp.
constructor
| loader | File object via which to load data |
Definition at line 72 of file Labels.cpp.
| ~CLabels | ( | ) | [virtual] |
Definition at line 83 of file Labels.cpp.
| void find_labels | ( | ) | [protected] |
find labels from the confidences using argmax over the classes.
Definition at line 173 of file Labels.cpp.
| float64_t * get_confidences | ( | int32_t & | out_num_labels, |
| int32_t & | out_num_classes | ||
| ) |
get confidences
| out_num_labels | number of labels |
| out_num_classes | number of classes will be written to it |
Definition at line 125 of file Labels.cpp.
| void get_confidences | ( | float64_t ** | dst, |
| int32_t * | out_num_labels, | ||
| int32_t * | out_num_classes | ||
| ) |
get confidences (swig compatible)
| dst | pointer to the confidences matrix (returned) |
| out_num_labels | number of labels (returned) |
| out_num_classes | number of classes will be written to it (returned) |
Definition at line 138 of file Labels.cpp.
| int32_t get_int_label | ( | int32_t | idx | ) |
| int32_t * get_int_labels | ( | int32_t & | len | ) |
get INT label vector caller has to clean up
| len | number of labels to get |
Definition at line 264 of file Labels.cpp.
| float64_t get_label | ( | int32_t | idx | ) |
| float64_t * get_labels | ( | int32_t & | len | ) |
get labels caller has to clean up
| len | number of labels |
Definition at line 234 of file Labels.cpp.
| void get_labels | ( | float64_t ** | dst, |
| int32_t * | len | ||
| ) |
get labels (swig compatible)
| dst | where labels will be stored in |
| len | where number of labels will be stored in |
Definition at line 249 of file Labels.cpp.
| virtual const char* get_name | ( | ) | const [virtual] |
| int32_t get_num_classes | ( | ) |
return number of classes (for multiclass) labels have to be zero based 0,1,...C missing labels are illegal
Definition at line 220 of file Labels.cpp.
| int32_t get_num_labels | ( | ) |
| float64_t * get_sample_confidences | ( | const int32_t & | in_sample_index, |
| int32_t & | out_num_classes | ||
| ) |
get confidences for a sample
| in_sample_index | index of a sample |
| out_num_classes | number of classes will be written to it |
Definition at line 154 of file Labels.cpp.
| bool is_two_class_labeling | ( | ) |
is two-class labeling
Definition at line 196 of file Labels.cpp.
| void load | ( | CFile * | loader | ) | [virtual] |
load labels from file
| loader | File object via which to load data |
Definition at line 289 of file Labels.cpp.
| void save | ( | CFile * | writer | ) | [virtual] |
save labels to file
| writer | File object via which to save data |
Definition at line 300 of file Labels.cpp.
| void set_confidences | ( | float64_t * | in_confidences, |
| int32_t | in_num_labels, | ||
| int32_t | in_num_classes | ||
| ) |
set confidences
| in_confidences | confidence matrix to be used to derive the labels |
| in_num_labels | number of labels |
| in_num_classes | number of classes |
Definition at line 102 of file Labels.cpp.
| bool set_int_label | ( | int32_t | idx, |
| int32_t | label | ||
| ) |
| void set_int_labels | ( | int32_t * | labels, |
| int32_t | len | ||
| ) |
set INT labels caller has to clean up
| labels | INT labels |
| len | number of INT labels |
Definition at line 279 of file Labels.cpp.
| bool set_label | ( | int32_t | idx, |
| float64_t | label | ||
| ) |
| void set_labels | ( | float64_t * | src, |
| int32_t | len | ||
| ) |
set labels
| src | labels to set |
| len | number of labels |
Definition at line 93 of file Labels.cpp.
float64_t* m_confidences [protected] |
int16_t m_num_classes [protected] |
int32_t num_labels [protected] |