Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes

CWDSVMOcas Class Reference


Detailed Description

class WDSVMOcas

Definition at line 26 of file WDSVMOcas.h.

Inheritance diagram for CWDSVMOcas:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CWDSVMOcas (void)
 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 c_neg, float64_t c_pos)
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 ()
CLabelsclassify ()
virtual CLabelsclassify (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 int 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 int compute_output (float64_t *output, void *ptr)
static int sort (float64_t *vals, float64_t *data, uint32_t size)
static void print (ocas_return_value_T value)

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_twd_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_tw
float32_told_w
float64_tlab
float32_t ** cuts
float64_tcp_bias

Constructor & Destructor Documentation

CWDSVMOcas ( void   ) 

default constructor

Definition at line 48 of file WDSVMOcas.cpp.

CWDSVMOcas ( E_SVM_TYPE  type  ) 

constructor

Parameters:
type type of SVM

Definition at line 64 of file WDSVMOcas.cpp.

CWDSVMOcas ( float64_t  C,
int32_t  d,
int32_t  from_d,
CStringFeatures< uint8_t > *  traindat,
CLabels trainlab 
)

constructor

Parameters:
C constant C
d degree
from_d from degree
traindat training features
trainlab labels for training features

Definition at line 78 of file WDSVMOcas.cpp.

~CWDSVMOcas (  )  [virtual]

Definition at line 95 of file WDSVMOcas.cpp.


Member Function Documentation

int 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

Parameters:
new_col_H new col H
new_cut new cut
cut_length length of cut
nSel nSel
ptr ptr

Definition at line 346 of file WDSVMOcas.cpp.

void * add_new_cut_helper ( void *  ptr  )  [static, protected]

helper function for adding a new cut

Parameters:
ptr 
Returns:
ptr

Definition at line 294 of file WDSVMOcas.cpp.

CLabels * classify ( CFeatures data  )  [virtual]

classify objects

Parameters:
data (test)data to be classified
Returns:
classified labels

Implements CClassifier.

Definition at line 121 of file WDSVMOcas.cpp.

CLabels * classify (  )  [virtual]

classify all examples

Returns:
resulting labels

Implements CClassifier.

Definition at line 99 of file WDSVMOcas.cpp.

virtual float64_t classify_example ( int32_t  num  )  [virtual]

classify one example

Parameters:
num number of example to classify
Returns:
classified result

Reimplemented from CClassifier.

Definition at line 179 of file WDSVMOcas.h.

int compute_output ( float64_t output,
void *  ptr 
) [static, protected]

compute output

Parameters:
output output
ptr ptr

Definition at line 537 of file WDSVMOcas.cpp.

void * compute_output_helper ( void *  ptr  )  [static, protected]

helper function for computing the output

Parameters:
ptr 
Returns:
ptr

Definition at line 445 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

Parameters:
sq_norm_W square normed W
dp_WoldW dp W old W
alpha alpha
nSel nSel
ptr ptr

Definition at line 607 of file WDSVMOcas.cpp.

bool get_bias_enabled (  ) 

check if bias is enabled

Returns:
if bias is enabled

Definition at line 130 of file WDSVMOcas.h.

int32_t get_bufsize (  ) 

get buffer size

Returns:
buffer size

Definition at line 142 of file WDSVMOcas.h.

float64_t get_C1 (  ) 

get C1

Returns:
C1

Definition at line 79 of file WDSVMOcas.h.

float64_t get_C2 (  ) 

get C2

Returns:
C2

Definition at line 85 of file WDSVMOcas.h.

virtual EClassifierType get_classifier_type (  )  [virtual]

get classifier type

Returns:
classifier type WDSVMOCAS

Reimplemented from CClassifier.

Definition at line 55 of file WDSVMOcas.h.

int32_t get_degree (  ) 

get degree

Returns:
degree

Definition at line 159 of file WDSVMOcas.h.

float64_t get_epsilon (  ) 

get epsilon

Returns:
epsilon

Definition at line 97 of file WDSVMOcas.h.

CStringFeatures<uint8_t>* get_features (  ) 

get features

Returns:
features

Definition at line 114 of file WDSVMOcas.h.

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

Implements CSGObject.

Definition at line 302 of file WDSVMOcas.h.

float64_t get_normalization_const (  ) 

get normalization const

Returns:
normalization const

Definition at line 223 of file WDSVMOcas.h.

static void print ( ocas_return_value_T  value  )  [static, protected]

print nothing

Definition at line 295 of file WDSVMOcas.h.

void set_bias_enabled ( bool  enable_bias  ) 

set if bias shall be enabled

Parameters:
enable_bias if bias shall be enabled

Definition at line 124 of file WDSVMOcas.h.

void set_bufsize ( int32_t  sz  ) 

set buffer size

Parameters:
sz buffer size

Definition at line 136 of file WDSVMOcas.h.

void set_C ( float64_t  c_neg,
float64_t  c_pos 
)

set C

Parameters:
c_neg new C constant for negatively labeled examples
c_pos new C constant for positively labeled examples

Definition at line 73 of file WDSVMOcas.h.

void set_degree ( int32_t  d,
int32_t  from_d 
)

set degree

Parameters:
d degree
from_d from degree

Definition at line 149 of file WDSVMOcas.h.

void set_epsilon ( float64_t  eps  ) 

set epsilon

Parameters:
eps new epsilon

Definition at line 91 of file WDSVMOcas.h.

void set_features ( CStringFeatures< uint8_t > *  feat  ) 

set features

Parameters:
feat features to set

Definition at line 103 of file WDSVMOcas.h.

void set_normalization_const (  ) 

set normalization const

Definition at line 208 of file WDSVMOcas.h.

int32_t set_wd_weights (  )  [protected]

set wd weights

Returns:
w_dim_single_c

Definition at line 136 of file WDSVMOcas.cpp.

int sort ( float64_t vals,
float64_t data,
uint32_t  size 
) [static, protected]

sort

Parameters:
vals vals
data data
size size

Definition at line 434 of file WDSVMOcas.cpp.

bool train ( CFeatures data = NULL  )  [virtual]

train classifier

Parameters:
data training data (parameter can be avoided if distance or kernel-based classifiers are used and distance/kernels are initialized with train data)
Returns:
whether training was successful

Reimplemented from CClassifier.

Definition at line 154 of file WDSVMOcas.cpp.

float64_t update_W ( float64_t  t,
void *  ptr 
) [static, protected]

update W

Parameters:
t t
ptr ptr
Returns:
something floaty

Definition at line 261 of file WDSVMOcas.cpp.


Member Data Documentation

int32_t alphabet_size [protected]

size of alphabet

Definition at line 331 of file WDSVMOcas.h.

float64_t bias [protected]

bias

Definition at line 337 of file WDSVMOcas.h.

int32_t bufsize [protected]

buffer size

Definition at line 310 of file WDSVMOcas.h.

float64_t C1 [protected]

C1

Definition at line 312 of file WDSVMOcas.h.

float64_t C2 [protected]

C2

Definition at line 314 of file WDSVMOcas.h.

float64_t* cp_bias [protected]

bias dimensions

Definition at line 356 of file WDSVMOcas.h.

float32_t** cuts [protected]

cuts

Definition at line 354 of file WDSVMOcas.h.

int32_t degree [protected]

degree

Definition at line 321 of file WDSVMOcas.h.

float64_t epsilon [protected]

epsilon

Definition at line 316 of file WDSVMOcas.h.

CStringFeatures<uint8_t>* features [protected]

features

Definition at line 306 of file WDSVMOcas.h.

int32_t from_degree [protected]

from degree

Definition at line 323 of file WDSVMOcas.h.

float64_t* lab [protected]

labels

Definition at line 351 of file WDSVMOcas.h.

E_SVM_TYPE method [protected]

method

Definition at line 318 of file WDSVMOcas.h.

normalization const

Definition at line 334 of file WDSVMOcas.h.

int32_t num_vec [protected]

num vectors

Definition at line 327 of file WDSVMOcas.h.

float64_t old_bias [protected]

old_bias

Definition at line 339 of file WDSVMOcas.h.

float32_t* old_w [protected]

old w

Definition at line 349 of file WDSVMOcas.h.

int32_t string_length [protected]

length of string in vector

Definition at line 329 of file WDSVMOcas.h.

bool use_bias [protected]

if bias shall be used

Definition at line 308 of file WDSVMOcas.h.

float32_t* w [protected]

w

Definition at line 347 of file WDSVMOcas.h.

int32_t w_dim [protected]

w dim

Definition at line 343 of file WDSVMOcas.h.

int32_t w_dim_single_char [protected]

w dim of a single char

Definition at line 345 of file WDSVMOcas.h.

int32_t* w_offsets [protected]

w offsets

Definition at line 341 of file WDSVMOcas.h.

float32_t* wd_weights [protected]

wd weights

Definition at line 325 of file WDSVMOcas.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation