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 24 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::CLabels (  ) 

default constructor

Definition at line 18 of file Labels.cpp.

CLabels::CLabels ( int32_t  num_labels  ) 

constructor

Parameters:
num_labels number of labels

Definition at line 25 of file Labels.cpp.

CLabels::CLabels ( float64_t src,
int32_t  len 
)

constructor

Parameters:
src labels to set
len number of labels

Definition at line 33 of file Labels.cpp.

CLabels::CLabels ( char *  fname  ) 

constructor

Parameters:
fname filename to load labels from

Definition at line 42 of file Labels.cpp.

CLabels::~CLabels (  )  [virtual]

Definition at line 51 of file Labels.cpp.


Member Function Documentation

int32_t CLabels::get_int_label ( int32_t  idx  ) 

get INT label

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

Definition at line 116 of file Labels.h.

int32_t * CLabels::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 129 of file Labels.cpp.

float64_t CLabels::get_label ( int32_t  idx  ) 

get label

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

Definition at line 103 of file Labels.h.

void CLabels::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 114 of file Labels.cpp.

float64_t * CLabels::get_labels ( int32_t &  len  ) 

get labels caller has to clean up

Parameters:
len number of labels
Returns:
the labels

Definition at line 99 of file Labels.cpp.

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

Implements CSGObject.

Definition at line 186 of file Labels.h.

int32_t CLabels::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 85 of file Labels.cpp.

int32_t CLabels::get_num_labels (  ) 

get number of labels

Returns:
number of labels

Definition at line 183 of file Labels.h.

bool CLabels::is_two_class_labeling (  ) 

is two-class labeling

Returns:
if this is two-class labeling

Definition at line 70 of file Labels.cpp.

bool CLabels::load ( char *  fname  ) 

load labels from file

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

Definition at line 154 of file Labels.cpp.

bool CLabels::save ( char *  fname  ) 

save labels to file

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

Definition at line 178 of file Labels.cpp.

bool CLabels::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 87 of file Labels.h.

void CLabels::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 144 of file Labels.cpp.

bool CLabels::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 70 of file Labels.h.

void CLabels::set_labels ( float64_t src,
int32_t  len 
)

set labels

Parameters:
src labels to set
len number of labels

Definition at line 58 of file Labels.cpp.


Member Data Documentation

float64_t* CLabels::labels [protected]

the labels

Definition at line 192 of file Labels.h.

int32_t CLabels::num_labels [protected]

number of labels

Definition at line 190 of file Labels.h.


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

SHOGUN Machine Learning Toolbox - Documentation