Detailed Description
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.
Definition at line 30 of file Labels.h.
List of all members.
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_to_one () |
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 |
int32_t | m_num_classes |
float64_t * | m_confidences |
int32_t | m_confidence_classes |
int32_t | m_confidence_labels |
Constructor & Destructor Documentation
default constructor
Definition at line 21 of file Labels.cpp.
constructor
- Parameters:
-
| num_labels | number of labels |
Definition at line 27 of file Labels.cpp.
constructor
- Parameters:
-
| src | labels to set |
| len | number of labels |
Definition at line 37 of file Labels.cpp.
CLabels |
( |
float64_t * |
in_confidences, |
|
|
int32_t |
in_num_labels, |
|
|
int32_t |
in_num_classes | |
|
) |
| | |
constructor
- Parameters:
-
| 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 60 of file Labels.cpp.
constructor
- Parameters:
-
| loader | File object via which to load data |
Definition at line 77 of file Labels.cpp.
Member Function Documentation
void find_labels |
( |
|
) |
[protected] |
find labels from the confidences using argmax over the classes.
Definition at line 197 of file Labels.cpp.
float64_t * get_confidences |
( |
int32_t & |
out_num_labels, |
|
|
int32_t & |
out_num_classes | |
|
) |
| | |
get confidences
- Parameters:
-
| out_num_labels | number of labels |
| out_num_classes | number of classes will be written to it |
- Returns:
- pointer to the confidences matrix
Definition at line 149 of file Labels.cpp.
void get_confidences |
( |
float64_t ** |
dst, |
|
|
int32_t * |
out_num_labels, |
|
|
int32_t * |
out_num_classes | |
|
) |
| | |
get confidences (swig compatible)
- Parameters:
-
| 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 162 of file Labels.cpp.
int32_t get_int_label |
( |
int32_t |
idx |
) |
|
get INT label
- Parameters:
-
| idx | index of label to get |
- Returns:
- INT value of label
Definition at line 129 of file Labels.h.
int32_t * get_int_labels |
( |
int32_t & |
len |
) |
|
get INT label vector caller has to clean up
- Parameters:
-
| len | number of labels to get |
- Returns:
- INT labels
Definition at line 288 of file Labels.cpp.
get label
- Parameters:
-
| idx | index of label to get |
- Returns:
- value of label
Definition at line 116 of file Labels.h.
get labels caller has to clean up
- Parameters:
-
- Returns:
- the labels
Definition at line 258 of file Labels.cpp.
void get_labels |
( |
float64_t ** |
dst, |
|
|
int32_t * |
len | |
|
) |
| | |
get labels (swig compatible)
- Parameters:
-
| dst | where labels will be stored in |
| len | where number of labels will be stored in |
Definition at line 273 of file Labels.cpp.
virtual const char* get_name |
( |
void |
|
) |
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
- Returns:
- number of classes
Definition at line 244 of file Labels.cpp.
int32_t get_num_labels |
( |
|
) |
|
get number of labels
- Returns:
- number of labels
Definition at line 228 of file Labels.h.
float64_t * get_sample_confidences |
( |
const int32_t & |
in_sample_index, |
|
|
int32_t & |
out_num_classes | |
|
) |
| | |
get confidences for a sample
- Parameters:
-
| in_sample_index | index of a sample |
| out_num_classes | number of classes will be written to it |
- Returns:
- pointer to the confidences vector
Definition at line 178 of file Labels.cpp.
bool is_two_class_labeling |
( |
|
) |
|
is two-class labeling
- Returns:
- if this is two-class labeling
Definition at line 220 of file Labels.cpp.
void load |
( |
CFile * |
loader |
) |
[virtual] |
load labels from file
- Parameters:
-
| loader | File object via which to load data |
Definition at line 313 of file Labels.cpp.
void save |
( |
CFile * |
writer |
) |
[virtual] |
save labels to file
- Parameters:
-
| writer | File object via which to save data |
Definition at line 328 of file Labels.cpp.
void set_confidences |
( |
float64_t * |
in_confidences, |
|
|
int32_t |
in_num_labels, |
|
|
int32_t |
in_num_classes | |
|
) |
| | |
set confidences
- Parameters:
-
| 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 124 of file Labels.cpp.
bool set_int_label |
( |
int32_t |
idx, |
|
|
int32_t |
label | |
|
) |
| | |
set INT label
- Parameters:
-
| idx | index of label to set |
| label | INT value of label |
- Returns:
- if setting was successful
Definition at line 100 of file Labels.h.
void set_int_labels |
( |
int32_t * |
labels, |
|
|
int32_t |
len | |
|
) |
| | |
set INT labels caller has to clean up
- Parameters:
-
| labels | INT labels |
| len | number of INT labels |
Definition at line 303 of file Labels.cpp.
bool set_label |
( |
int32_t |
idx, |
|
|
float64_t |
label | |
|
) |
| | |
set label
- Parameters:
-
| idx | index of label to set |
| label | value of label |
- Returns:
- if setting was successful
Definition at line 83 of file Labels.h.
void set_labels |
( |
float64_t * |
src, |
|
|
int32_t |
len | |
|
) |
| | |
set labels
- Parameters:
-
| src | labels to set |
| len | number of labels |
Definition at line 115 of file Labels.cpp.
set all labels to +1
Definition at line 53 of file Labels.cpp.
Member Data Documentation
confidence matrix of size: num_classes x num_labels
Definition at line 247 of file Labels.h.
number of classes
Definition at line 244 of file Labels.h.
number of labels
Definition at line 239 of file Labels.h.
The documentation for this class was generated from the following files: