SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
List of all members | Public Member Functions | Protected Member Functions | Static Protected Member Functions | Protected Attributes
CSVMOcas Class Reference

Detailed Description

class SVMOcas

Definition at line 32 of file SVMOcas.h.

Inheritance diagram for CSVMOcas:
Inheritance graph
[legend]

Public Member Functions

 CSVMOcas ()
 CSVMOcas (E_SVM_TYPE type)
 CSVMOcas (float64_t C, CDotFeatures *traindat, CLabels *trainlab)
virtual ~CSVMOcas ()
virtual EClassifierType get_classifier_type ()
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_bias_enabled (bool enable_bias)
bool get_bias_enabled ()
void set_bufsize (int32_t sz)
int32_t get_bufsize ()
- Public Member Functions inherited from CLinearMachine
 CLinearMachine ()
virtual ~CLinearMachine ()
void get_w (float64_t *&dst_w, int32_t &dst_dims)
SGVector< float64_tget_w ()
void set_w (SGVector< float64_t > src_w)
void set_bias (float64_t b)
float64_t get_bias ()
virtual bool load (FILE *srcfile)
virtual bool save (FILE *dstfile)
virtual void set_features (CDotFeatures *feat)
virtual CLabelsapply ()
virtual CLabelsapply (CFeatures *data)
virtual float64_t apply (int32_t vec_idx)
 get output for example "vec_idx"
virtual CDotFeaturesget_features ()
- Public Member Functions inherited from CMachine
 CMachine ()
virtual ~CMachine ()
virtual bool train (CFeatures *data=NULL)
virtual void set_labels (CLabels *lab)
virtual CLabelsget_labels ()
virtual float64_t get_label (int32_t i)
void set_max_train_time (float64_t t)
float64_t get_max_train_time ()
void set_solver_type (ESolverType st)
ESolverType get_solver_type ()
virtual void set_store_model_features (bool store_model)
- Public Member Functions inherited from CSGObject
 CSGObject ()
 CSGObject (const CSGObject &orig)
virtual ~CSGObject ()
virtual bool is_generic (EPrimitiveType *generic) const
template<class T >
void set_generic ()
void unset_generic ()
virtual void print_serializable (const char *prefix="")
virtual bool save_serializable (CSerializableFile *file, const char *prefix="")
virtual bool load_serializable (CSerializableFile *file, const char *prefix="")
void set_global_io (SGIO *io)
SGIOget_global_io ()
void set_global_parallel (Parallel *parallel)
Parallelget_global_parallel ()
void set_global_version (Version *version)
Versionget_global_version ()
SGVector< char * > get_modelsel_names ()
char * get_modsel_param_descr (const char *param_name)
index_t get_modsel_param_index (const char *param_name)

Protected Member Functions

virtual bool train_machine (CFeatures *data=NULL)
virtual const char * get_name () const
- Protected Member Functions inherited from CLinearMachine
virtual void store_model_features ()

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 int add_new_cut (float64_t *new_col_H, uint32_t *new_cut, uint32_t cut_length, uint32_t nSel, 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

bool use_bias
int32_t bufsize
float64_t C1
float64_t C2
float64_t epsilon
E_SVM_TYPE method
float64_told_w
float64_t old_bias
float64_ttmp_a_buf
SGVector< float64_tlab
float64_t ** cp_value
uint32_t ** cp_index
uint32_t * cp_nz_dims
float64_tcp_bias
- Protected Attributes inherited from CLinearMachine
int32_t w_dim
float64_tw
float64_t bias
CDotFeaturesfeatures
- Protected Attributes inherited from CMachine
float64_t max_train_time
CLabelslabels
ESolverType solver_type
bool m_store_model_features

Additional Inherited Members

- Public Attributes inherited from CSGObject
SGIOio
Parallelparallel
Versionversion
Parameterm_parameters
Parameterm_model_selection_parameters

Constructor & Destructor Documentation

CSVMOcas ( )

default constructor

Definition at line 24 of file SVMOcas.cpp.

CSVMOcas ( E_SVM_TYPE  type)

constructor

Parameters
typea E_SVM_TYPE

Definition at line 30 of file SVMOcas.cpp.

CSVMOcas ( float64_t  C,
CDotFeatures traindat,
CLabels trainlab 
)

constructor

Parameters
Cconstant C
traindattraining features
trainlablabels for training features

Definition at line 37 of file SVMOcas.cpp.

~CSVMOcas ( )
virtual

Definition at line 50 of file SVMOcas.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 
)
staticprotected

add new cut

Parameters
new_col_Hnew col H
new_cutnew cut
cut_lengthlength of cut
nSelnSel
ptrptr

Definition at line 185 of file SVMOcas.cpp.

int compute_output ( float64_t output,
void *  ptr 
)
staticprotected

compute output

Parameters
outputoutput
ptrptr

Definition at line 272 of file SVMOcas.cpp.

void compute_W ( float64_t sq_norm_W,
float64_t dp_WoldW,
float64_t alpha,
uint32_t  nSel,
void *  ptr 
)
staticprotected

compute W

Parameters
sq_norm_Wsquare normed W
dp_WoldWdp W old W
alphaalpha
nSelnSel
ptrptr

Definition at line 298 of file SVMOcas.cpp.

bool get_bias_enabled ( )

check if bias is enabled

Returns
if bias is enabled

Definition at line 103 of file SVMOcas.h.

int32_t get_bufsize ( )

get buffer size

Returns
buffer size

Definition at line 115 of file SVMOcas.h.

float64_t get_C1 ( )

get C1

Returns
C1

Definition at line 73 of file SVMOcas.h.

float64_t get_C2 ( )

get C2

Returns
C2

Definition at line 79 of file SVMOcas.h.

virtual EClassifierType get_classifier_type ( )
virtual

get classifier type

Returns
classifier type SVMOCAS

Reimplemented from CMachine.

Definition at line 59 of file SVMOcas.h.

float64_t get_epsilon ( )

get epsilon

Returns
epsilon

Definition at line 91 of file SVMOcas.h.

virtual const char* get_name ( ) const
protectedvirtual
Returns
object name

Reimplemented from CLinearMachine.

Definition at line 183 of file SVMOcas.h.

static void print ( ocas_return_value_T  value)
staticprotected

print nothing

Definition at line 166 of file SVMOcas.h.

void set_bias_enabled ( bool  enable_bias)

set if bias shall be enabled

Parameters
enable_biasif bias shall be enabled

Definition at line 97 of file SVMOcas.h.

void set_bufsize ( int32_t  sz)

set buffer size

Parameters
szbuffer size

Definition at line 109 of file SVMOcas.h.

void set_C ( float64_t  c_neg,
float64_t  c_pos 
)

set C

Parameters
c_negnew C constant for negatively labeled examples
c_posnew C constant for positively labeled examples

Definition at line 67 of file SVMOcas.h.

void set_epsilon ( float64_t  eps)

set epsilon

Parameters
epsnew epsilon

Definition at line 85 of file SVMOcas.h.

int sort ( float64_t vals,
float64_t data,
uint32_t  size 
)
staticprotected

sort

Parameters
valsvals
datadata
sizesize

Definition at line 261 of file SVMOcas.cpp.

bool train_machine ( CFeatures data = NULL)
protectedvirtual

train SVM classifier

Parameters
datatraining 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 CMachine.

Definition at line 54 of file SVMOcas.cpp.

float64_t update_W ( float64_t  t,
void *  ptr 
)
staticprotected

update W

Parameters
tt
ptrptr
Returns
something floaty

Definition at line 158 of file SVMOcas.cpp.

Member Data Documentation

int32_t bufsize
protected

buffer size

Definition at line 191 of file SVMOcas.h.

float64_t C1
protected

C1

Definition at line 193 of file SVMOcas.h.

float64_t C2
protected

C2

Definition at line 195 of file SVMOcas.h.

float64_t* cp_bias
protected

bias dimensions

Definition at line 218 of file SVMOcas.h.

uint32_t** cp_index
protected

cutting plane index

Definition at line 214 of file SVMOcas.h.

uint32_t* cp_nz_dims
protected

cutting plane dimensions

Definition at line 216 of file SVMOcas.h.

float64_t** cp_value
protected

sparse representation of cutting planes

Definition at line 212 of file SVMOcas.h.

float64_t epsilon
protected

epsilon

Definition at line 197 of file SVMOcas.h.

SGVector<float64_t> lab
protected

labels

Definition at line 208 of file SVMOcas.h.

E_SVM_TYPE method
protected

method

Definition at line 199 of file SVMOcas.h.

float64_t old_bias
protected

old bias

Definition at line 204 of file SVMOcas.h.

float64_t* old_w
protected

old W

Definition at line 202 of file SVMOcas.h.

float64_t* tmp_a_buf
protected

nDim big

Definition at line 206 of file SVMOcas.h.

bool use_bias
protected

if bias is used

Definition at line 189 of file SVMOcas.h.


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

SHOGUN Machine Learning Toolbox - Documentation