
Definition at line 27 of file SVMOcas.h.
Public Member Functions | |
| CSVMOcas (E_SVM_TYPE type) | |
| CSVMOcas (DREAL C, CSparseFeatures< DREAL > *traindat, CLabels *trainlab) | |
| virtual | ~CSVMOcas () |
| virtual EClassifierType | get_classifier_type () |
| virtual bool | train () |
| void | set_C (DREAL c1, DREAL c2) |
| DREAL | get_C1 () |
| DREAL | get_C2 () |
| void | set_epsilon (DREAL eps) |
| DREAL | get_epsilon () |
| void | set_bias_enabled (bool enable_bias) |
| bool | get_bias_enabled () |
| void | set_bufsize (INT sz) |
| INT | get_bufsize () |
| virtual CLabels * | classify (CLabels *output=NULL) |
| virtual DREAL | classify_example (INT vec_idx) |
| get output for example "vec_idx" | |
| void | get_w (DREAL **dst_w, INT *dst_dims) |
| void | set_w (DREAL *src_w, INT src_w_dim) |
| void | set_bias (DREAL b) |
| DREAL | get_bias () |
| void | set_features (CSparseFeatures< DREAL > *feat) |
| CSparseFeatures< DREAL > * | get_features () |
| virtual bool | load (FILE *srcfile) |
| virtual bool | save (FILE *dstfile) |
| virtual void | set_labels (CLabels *lab) |
| virtual CLabels * | get_labels () |
| virtual DREAL | get_label (INT i) |
| void | set_max_train_time (DREAL t) |
| DREAL | get_max_train_time () |
Static Public Attributes | |
| static CParallel | parallel |
| static CIO | io |
| static CVersion | version |
Static Protected Member Functions | |
| static void | compute_W (double *sq_norm_W, double *dp_WoldW, double *alpha, uint32_t nSel, void *ptr) |
| static double | update_W (double t, void *ptr) |
| static void | add_new_cut (double *new_col_H, uint32_t *new_cut, uint32_t cut_length, uint32_t nSel, void *ptr) |
| static void | compute_output (double *output, void *ptr) |
| static void | sort (double *vals, uint32_t *idx, uint32_t size) |
Protected Attributes | |
| bool | use_bias |
| INT | bufsize |
| DREAL | C1 |
| DREAL | C2 |
| DREAL | epsilon |
| E_SVM_TYPE | method |
| DREAL * | old_w |
| DREAL * | tmp_a_buf |
| DREAL * | lab |
| DREAL ** | cp_value |
| uint32_t ** | cp_index |
| uint32_t * | cp_nz_dims |
| INT | w_dim |
| DREAL * | w |
| DREAL | bias |
| CSparseFeatures< DREAL > * | features |
| DREAL | max_train_time |
| CLabels * | labels |
| CSVMOcas::CSVMOcas | ( | E_SVM_TYPE | type | ) |
| CSVMOcas::CSVMOcas | ( | DREAL | C, | |
| CSparseFeatures< DREAL > * | traindat, | |||
| CLabels * | trainlab | |||
| ) |
constructor
| C | constant C | |
| traindat | training features | |
| trainlab | labels for training features |
Definition at line 30 of file SVMOcas.cpp.
| CSVMOcas::~CSVMOcas | ( | ) | [virtual] |
Definition at line 42 of file SVMOcas.cpp.
| virtual EClassifierType CSVMOcas::get_classifier_type | ( | ) | [virtual] |
| bool CSVMOcas::train | ( | ) | [virtual] |
train SVM
Reimplemented from CClassifier.
Definition at line 46 of file SVMOcas.cpp.
| void CSVMOcas::set_epsilon | ( | DREAL | eps | ) |
| DREAL CSVMOcas::get_epsilon | ( | ) |
| void CSVMOcas::set_bias_enabled | ( | bool | enable_bias | ) |
| bool CSVMOcas::get_bias_enabled | ( | ) |
| void CSVMOcas::set_bufsize | ( | INT | sz | ) |
| INT CSVMOcas::get_bufsize | ( | ) |
| void CSVMOcas::compute_W | ( | double * | sq_norm_W, | |
| double * | dp_WoldW, | |||
| double * | 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 258 of file SVMOcas.cpp.
| double CSVMOcas::update_W | ( | double | t, | |
| void * | ptr | |||
| ) | [static, protected] |
update W
| t | t | |
| ptr | ptr |
Definition at line 134 of file SVMOcas.cpp.
| void CSVMOcas::add_new_cut | ( | double * | 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 159 of file SVMOcas.cpp.
| void CSVMOcas::compute_output | ( | double * | output, | |
| void * | ptr | |||
| ) | [static, protected] |
| void CSVMOcas::sort | ( | double * | vals, | |
| uint32_t * | idx, | |||
| uint32_t | size | |||
| ) | [static, protected] |
classify all examples
| output | resulting labels |
Reimplemented from CClassifier.
Definition at line 24 of file SparseLinearClassifier.cpp.
get output for example "vec_idx"
Reimplemented from CClassifier.
Definition at line 34 of file SparseLinearClassifier.h.
get w
| dst_w | store w in this argument | |
| dst_dims | dimension of w |
Definition at line 44 of file SparseLinearClassifier.h.
set w
| src_w | new w | |
| src_w_dim | dimension of new w |
Definition at line 59 of file SparseLinearClassifier.h.
| void CSparseLinearClassifier::set_bias | ( | DREAL | b | ) | [inherited] |
| DREAL CSparseLinearClassifier::get_bias | ( | ) | [inherited] |
| void CSparseLinearClassifier::set_features | ( | CSparseFeatures< DREAL > * | feat | ) | [inherited] |
set features
| feat | features to set |
Definition at line 87 of file SparseLinearClassifier.h.
| CSparseFeatures<DREAL>* CSparseLinearClassifier::get_features | ( | ) | [inherited] |
| virtual bool CClassifier::load | ( | FILE * | srcfile | ) | [virtual, inherited] |
load Classifier from file
abstract base method
| srcfile | file to load from |
Reimplemented in CKernelPerceptron, CKNN, CLinearClassifier, CSVM, CHierarchical, and CKMeans.
Definition at line 56 of file Classifier.h.
| virtual bool CClassifier::save | ( | FILE * | dstfile | ) | [virtual, inherited] |
save Classifier to file
abstract base method
| dstfile | file to save to |
Reimplemented in CKernelPerceptron, CKNN, CLinearClassifier, CSVM, CHierarchical, and CKMeans.
Definition at line 65 of file Classifier.h.
| virtual void CClassifier::set_labels | ( | CLabels * | lab | ) | [virtual, inherited] |
| virtual CLabels* CClassifier::get_labels | ( | ) | [virtual, inherited] |
get one specific label
| i | index of label to get |
Definition at line 89 of file Classifier.h.
| void CClassifier::set_max_train_time | ( | DREAL | t | ) | [inherited] |
set maximum training time
| t | maximimum training time |
Definition at line 95 of file Classifier.h.
| DREAL CClassifier::get_max_train_time | ( | ) | [inherited] |
get maximum training time
Definition at line 101 of file Classifier.h.
bool CSVMOcas::use_bias [protected] |
INT CSVMOcas::bufsize [protected] |
DREAL CSVMOcas::C1 [protected] |
DREAL CSVMOcas::C2 [protected] |
DREAL CSVMOcas::epsilon [protected] |
E_SVM_TYPE CSVMOcas::method [protected] |
DREAL* CSVMOcas::old_w [protected] |
DREAL* CSVMOcas::tmp_a_buf [protected] |
DREAL* CSVMOcas::lab [protected] |
DREAL** CSVMOcas::cp_value [protected] |
uint32_t** CSVMOcas::cp_index [protected] |
uint32_t* CSVMOcas::cp_nz_dims [protected] |
INT CSparseLinearClassifier::w_dim [protected, inherited] |
dimension of w
Definition at line 102 of file SparseLinearClassifier.h.
DREAL* CSparseLinearClassifier::w [protected, inherited] |
w
Definition at line 104 of file SparseLinearClassifier.h.
DREAL CSparseLinearClassifier::bias [protected, inherited] |
bias
Definition at line 106 of file SparseLinearClassifier.h.
CSparseFeatures<DREAL>* CSparseLinearClassifier::features [protected, inherited] |
features
Definition at line 108 of file SparseLinearClassifier.h.
DREAL CClassifier::max_train_time [protected, inherited] |
maximum training time
Definition at line 111 of file Classifier.h.
CLabels* CClassifier::labels [protected, inherited] |
labels
Definition at line 114 of file Classifier.h.
CParallel CSGObject::parallel [static, inherited] |
Definition at line 105 of file SGObject.h.
CIO CSGObject::io [static, inherited] |
Definition at line 106 of file SGObject.h.
CVersion CSGObject::version [static, inherited] |
Definition at line 107 of file SGObject.h.