Detailed Description
A generic Support Vector Machine Interface.
A support vector machine is defined as
where
is the number of training examples
are the weights assigned to each training example
is the kernel and
the bias.
Using an a-priori choosen kernel, the
and bias are determined by solving the following quadratic program
here C is a pre-specified regularization parameter.
Definition at line 47 of file SVM.h.
List of all members.
Constructor & Destructor Documentation
CSVM |
( |
int32_t |
num_sv = 0 |
) |
|
Create an empty Support Vector Machine Object
- Parameters:
-
| num_sv | with num_sv support vectors |
Definition at line 31 of file SVM.cpp.
Create a Support Vector Machine Object from a trained SVM
- Parameters:
-
| C | the C parameter |
| k | the Kernel object |
| lab | the Label object |
Definition at line 40 of file SVM.cpp.
Member Function Documentation
compute svm dual objective
- Returns:
- computed dual objective
Definition at line 229 of file SVM.cpp.
compute svm primal objective
- Returns:
- computed svm primal objective
Definition at line 254 of file SVM.cpp.
get C1
- Returns:
- C1
Definition at line 154 of file SVM.h.
get C2
- Returns:
- C2
Definition at line 160 of file SVM.h.
get epsilon
- Returns:
- epsilon
Definition at line 142 of file SVM.h.
std::vector< float64_t > get_linear_term |
( |
|
) |
[virtual] |
get linear term
- Returns:
- lin the linear term
Definition at line 311 of file SVM.cpp.
float64_t * get_linear_term_array |
( |
|
) |
[protected, virtual] |
get linear term copy as dynamic array
- Returns:
- linear term copied to a dynamic array
Definition at line 281 of file SVM.cpp.
virtual const char* get_name |
( |
|
) |
const [virtual] |
- Returns:
- object name
Implements CSGObject.
Reimplemented in CMKL, CGMNPSVM, CGNPPSVM, CGPBTSVM, CLaRank, CLibSVM, CLibSVMMultiClass, CLibSVMOneClass, CMPDSVM, CScatterSVM, and CLibSVR.
Definition at line 227 of file SVM.h.
get nu
- Returns:
- nu
Definition at line 148 of file SVM.h.
get objective
- Returns:
- objective
Definition at line 211 of file SVM.h.
get qpsize
- Returns:
- qpsize
Definition at line 166 of file SVM.h.
bool get_shrinking_enabled |
( |
|
) |
|
get state of shrinking
- Returns:
- if shrinking is enabled
Definition at line 181 of file SVM.h.
get tube epsilon
- Returns:
- tube epsilon
Definition at line 130 of file SVM.h.
bool load |
( |
FILE * |
svm_file |
) |
[virtual] |
bool save |
( |
FILE * |
svm_file |
) |
[virtual] |
set C
- Parameters:
-
| c_neg | new C constant for negatively labeled examples |
| c_pos | new C constant for positively labeled examples |
Note that not all SVMs support this (however at least CLibSVM and CSVMLight do)
Definition at line 111 of file SVM.h.
set callback function svm optimizers may call when they have a new (small) set of alphas
- Parameters:
-
| m | pointer to mkl object |
| cb | callback function |
Definition at line 219 of file SVM.cpp.
void set_defaults |
( |
int32_t |
num_sv = 0 |
) |
|
set default values for members a SVM object
Definition at line 57 of file SVM.cpp.
set epsilon
- Parameters:
-
Definition at line 118 of file SVM.h.
void set_linear_term |
( |
std::vector< float64_t > |
lin |
) |
[virtual] |
set linear term of the QP
- Parameters:
-
Definition at line 292 of file SVM.cpp.
set nu
- Parameters:
-
Definition at line 100 of file SVM.h.
set objective
- Parameters:
-
Definition at line 202 of file SVM.h.
void set_qpsize |
( |
int32_t |
qps |
) |
|
set qpsize
- Parameters:
-
Definition at line 136 of file SVM.h.
void set_shrinking_enabled |
( |
bool |
enable |
) |
|
set state of shrinking
- Parameters:
-
| enable | if shrinking will be enabled |
Definition at line 172 of file SVM.h.
set tube epsilon
- Parameters:
-
Definition at line 124 of file SVM.h.
Member Data Documentation
C1 regularization const
Definition at line 308 of file SVM.h.
C2
Definition at line 310 of file SVM.h.
callback function svm optimizers may call when they have a new (small) set of alphas
Definition at line 320 of file SVM.h.
epsilon
Definition at line 302 of file SVM.h.
linear term in qp
Definition at line 297 of file SVM.h.
mkl object that svm optimizers need to pass when calling the callback function
Definition at line 323 of file SVM.h.
nu
Definition at line 306 of file SVM.h.
objective
Definition at line 312 of file SVM.h.
qpsize
Definition at line 314 of file SVM.h.
if SVM is loaded
Definition at line 300 of file SVM.h.
tube epsilon for support vector regression
Definition at line 304 of file SVM.h.
if shrinking shall be used
Definition at line 316 of file SVM.h.
The documentation for this class was generated from the following files: