class WDSVMOcas
Definition at line 26 of file WDSVMOcas.h.
Public Member Functions | |
CWDSVMOcas (E_SVM_TYPE type) | |
CWDSVMOcas (float64_t C, int32_t d, int32_t from_d, CStringFeatures< uint8_t > *traindat, CLabels *trainlab) | |
virtual | ~CWDSVMOcas () |
virtual EClassifierType | get_classifier_type () |
virtual bool | train (CFeatures *data=NULL) |
void | set_C (float64_t c1, float64_t c2) |
float64_t | get_C1 () |
float64_t | get_C2 () |
void | set_epsilon (float64_t eps) |
float64_t | get_epsilon () |
void | set_features (CStringFeatures< uint8_t > *feat) |
CStringFeatures< uint8_t > * | get_features () |
void | set_bias_enabled (bool enable_bias) |
bool | get_bias_enabled () |
void | set_bufsize (int32_t sz) |
int32_t | get_bufsize () |
void | set_degree (int32_t d, int32_t from_d) |
int32_t | get_degree () |
CLabels * | classify () |
virtual CLabels * | classify (CFeatures *data) |
virtual float64_t | classify_example (int32_t num) |
void | set_normalization_const () |
float64_t | get_normalization_const () |
Protected Member Functions | |
int32_t | set_wd_weights () |
virtual const char * | get_name () const |
Static Protected Member Functions | |
static void | compute_W (float64_t *sq_norm_W, float64_t *dp_WoldW, float64_t *alpha, uint32_t nSel, void *ptr) |
static float64_t | update_W (float64_t t, void *ptr) |
static void * | add_new_cut_helper (void *ptr) |
static void | add_new_cut (float64_t *new_col_H, uint32_t *new_cut, uint32_t cut_length, uint32_t nSel, void *ptr) |
static void * | compute_output_helper (void *ptr) |
static void | compute_output (float64_t *output, void *ptr) |
static void | sort (float64_t *vals, uint32_t *idx, uint32_t size) |
Protected Attributes | |
CStringFeatures< uint8_t > * | features |
bool | use_bias |
int32_t | bufsize |
float64_t | C1 |
float64_t | C2 |
float64_t | epsilon |
E_SVM_TYPE | method |
int32_t | degree |
int32_t | from_degree |
float32_t * | wd_weights |
int32_t | num_vec |
int32_t | string_length |
int32_t | alphabet_size |
float64_t | normalization_const |
float64_t | bias |
float64_t | old_bias |
int32_t * | w_offsets |
int32_t | w_dim |
int32_t | w_dim_single_char |
float32_t * | w |
float32_t * | old_w |
float64_t * | lab |
float32_t ** | cuts |
float64_t * | cp_bias |
CWDSVMOcas | ( | E_SVM_TYPE | type | ) |
CWDSVMOcas | ( | float64_t | C, | |
int32_t | d, | |||
int32_t | from_d, | |||
CStringFeatures< uint8_t > * | traindat, | |||
CLabels * | trainlab | |||
) |
constructor
C | constant C | |
d | degree | |
from_d | from degree | |
traindat | training features | |
trainlab | labels for training features |
Definition at line 62 of file WDSVMOcas.cpp.
~CWDSVMOcas | ( | ) | [virtual] |
Definition at line 79 of file WDSVMOcas.cpp.
void add_new_cut | ( | float64_t * | new_col_H, | |
uint32_t * | new_cut, | |||
uint32_t | cut_length, | |||
uint32_t | nSel, | |||
void * | ptr | |||
) | [static, protected] |
add new cut
new_col_H | new col H | |
new_cut | new cut | |
cut_length | length of cut | |
nSel | nSel | |
ptr | ptr |
Definition at line 329 of file WDSVMOcas.cpp.
void * add_new_cut_helper | ( | void * | ptr | ) | [static, protected] |
helper function for adding a new cut
ptr |
Definition at line 277 of file WDSVMOcas.cpp.
classify objects
data | (test)data to be classified |
Implements CClassifier.
Definition at line 105 of file WDSVMOcas.cpp.
CLabels * classify | ( | ) | [virtual] |
classify all examples
Implements CClassifier.
Definition at line 83 of file WDSVMOcas.cpp.
virtual float64_t classify_example | ( | int32_t | num | ) | [virtual] |
classify one example
num | number of example to classify |
Reimplemented from CClassifier.
Definition at line 175 of file WDSVMOcas.h.
void compute_output | ( | float64_t * | output, | |
void * | ptr | |||
) | [static, protected] |
void * compute_output_helper | ( | void * | ptr | ) | [static, protected] |
helper function for computing the output
ptr |
Definition at line 425 of file WDSVMOcas.cpp.
void compute_W | ( | float64_t * | sq_norm_W, | |
float64_t * | dp_WoldW, | |||
float64_t * | alpha, | |||
uint32_t | nSel, | |||
void * | ptr | |||
) | [static, protected] |
compute W
sq_norm_W | square normed W | |
dp_WoldW | dp W old W | |
alpha | alpha | |
nSel | nSel | |
ptr | ptr |
Definition at line 586 of file WDSVMOcas.cpp.
bool get_bias_enabled | ( | ) |
int32_t get_bufsize | ( | ) |
float64_t get_C1 | ( | ) |
float64_t get_C2 | ( | ) |
virtual EClassifierType get_classifier_type | ( | ) | [virtual] |
get classifier type
Reimplemented from CClassifier.
Definition at line 52 of file WDSVMOcas.h.
int32_t get_degree | ( | ) |
float64_t get_epsilon | ( | ) |
CStringFeatures<uint8_t>* get_features | ( | ) |
virtual const char* get_name | ( | ) | const [protected, virtual] |
float64_t get_normalization_const | ( | ) |
void set_bias_enabled | ( | bool | enable_bias | ) |
set if bias shall be enabled
enable_bias | if bias shall be enabled |
Definition at line 120 of file WDSVMOcas.h.
void set_bufsize | ( | int32_t | sz | ) |
void set_degree | ( | int32_t | d, | |
int32_t | from_d | |||
) |
void set_epsilon | ( | float64_t | eps | ) |
void set_features | ( | CStringFeatures< uint8_t > * | feat | ) |
void set_normalization_const | ( | ) |
set normalization const
Definition at line 204 of file WDSVMOcas.h.
int32_t set_wd_weights | ( | ) | [protected] |
void sort | ( | float64_t * | vals, | |
uint32_t * | idx, | |||
uint32_t | size | |||
) | [static, protected] |
bool train | ( | CFeatures * | data = NULL |
) | [virtual] |
train classifier
data | training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data) |
Reimplemented from CClassifier.
Definition at line 138 of file WDSVMOcas.cpp.
update W
t | t | |
ptr | ptr |
Definition at line 244 of file WDSVMOcas.cpp.
int32_t alphabet_size [protected] |
size of alphabet
Definition at line 320 of file WDSVMOcas.h.
bias
Definition at line 326 of file WDSVMOcas.h.
int32_t bufsize [protected] |
buffer size
Definition at line 299 of file WDSVMOcas.h.
C1
Definition at line 301 of file WDSVMOcas.h.
C2
Definition at line 303 of file WDSVMOcas.h.
bias dimensions
Definition at line 345 of file WDSVMOcas.h.
cuts
Definition at line 343 of file WDSVMOcas.h.
int32_t degree [protected] |
degree
Definition at line 310 of file WDSVMOcas.h.
epsilon
Definition at line 305 of file WDSVMOcas.h.
CStringFeatures<uint8_t>* features [protected] |
features
Definition at line 295 of file WDSVMOcas.h.
int32_t from_degree [protected] |
from degree
Definition at line 312 of file WDSVMOcas.h.
labels
Definition at line 340 of file WDSVMOcas.h.
E_SVM_TYPE method [protected] |
method
Definition at line 307 of file WDSVMOcas.h.
float64_t normalization_const [protected] |
normalization const
Definition at line 323 of file WDSVMOcas.h.
int32_t num_vec [protected] |
num vectors
Definition at line 316 of file WDSVMOcas.h.
old_bias
Definition at line 328 of file WDSVMOcas.h.
old w
Definition at line 338 of file WDSVMOcas.h.
int32_t string_length [protected] |
length of string in vector
Definition at line 318 of file WDSVMOcas.h.
bool use_bias [protected] |
if bias shall be used
Definition at line 297 of file WDSVMOcas.h.
w
Definition at line 336 of file WDSVMOcas.h.
int32_t w_dim [protected] |
w dim
Definition at line 332 of file WDSVMOcas.h.
int32_t w_dim_single_char [protected] |
w dim of a single char
Definition at line 334 of file WDSVMOcas.h.
int32_t* w_offsets [protected] |
w offsets
Definition at line 330 of file WDSVMOcas.h.
float32_t* wd_weights [protected] |
wd weights
Definition at line 314 of file WDSVMOcas.h.