CLabels Class Reference


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 26 of file Labels.h.

Inheritance diagram for CLabels:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CLabels ()
 CLabels (int32_t num_labels)
 CLabels (float64_t *src, int32_t len)
 CLabels (char *fname)
virtual ~CLabels ()
bool load (char *fname)
bool save (char *fname)
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_tget_labels (int32_t &len)
void get_labels (float64_t **dst, int32_t *len)
void set_labels (float64_t *src, int32_t len)
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 Attributes

int32_t num_labels
float64_tlabels

Constructor & Destructor Documentation

CLabels (  ) 

default constructor

Definition at line 25 of file Labels.cpp.

CLabels ( int32_t  num_labels  ) 

constructor

Parameters:
num_labels number of labels

Definition at line 32 of file Labels.cpp.

CLabels ( float64_t src,
int32_t  len 
)

constructor

Parameters:
src labels to set
len number of labels

Definition at line 40 of file Labels.cpp.

CLabels ( char *  fname  ) 

constructor

Parameters:
fname filename to load labels from

Definition at line 49 of file Labels.cpp.

~CLabels (  )  [virtual]

Definition at line 58 of file Labels.cpp.


Member Function Documentation

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 118 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 142 of file Labels.cpp.

float64_t get_label ( int32_t  idx  ) 

get label

Parameters:
idx index of label to get
Returns:
value of label

Definition at line 105 of file Labels.h.

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 127 of file Labels.cpp.

float64_t * get_labels ( int32_t &  len  ) 

get labels caller has to clean up

Parameters:
len number of labels
Returns:
the labels

Definition at line 112 of file Labels.cpp.

virtual const char* get_name (  )  const [virtual]
Returns:
object name

Implements CSGObject.

Definition at line 188 of file Labels.h.

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 98 of file Labels.cpp.

int32_t get_num_labels (  ) 

get number of labels

Returns:
number of labels

Definition at line 185 of file Labels.h.

bool is_two_class_labeling (  ) 

is two-class labeling

Returns:
if this is two-class labeling

Definition at line 74 of file Labels.cpp.

bool load ( char *  fname  ) 

load labels from file

Parameters:
fname filename to load from
Returns:
if loading was successful

Definition at line 167 of file Labels.cpp.

bool save ( char *  fname  ) 

save labels to file

Parameters:
fname filename to save to
Returns:
if saving was successful

Definition at line 191 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 89 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 157 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 72 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 65 of file Labels.cpp.


Member Data Documentation

float64_t* labels [protected]

the labels

Definition at line 275 of file Labels.h.

int32_t num_labels [protected]

number of labels

Definition at line 273 of file Labels.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation