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 46 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 27 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 33 of file SVM.cpp.
Member Function Documentation
compute svm dual objective
- Returns:
- computed dual objective
Definition at line 247 of file SVM.cpp.
compute svm primal objective
- Returns:
- computed svm primal objective
Definition at line 272 of file SVM.cpp.
get C1
- Returns:
- C1
Definition at line 156 of file SVM.h.
get C2
- Returns:
- C2
Definition at line 162 of file SVM.h.
get epsilon
- Returns:
- epsilon
Definition at line 144 of file SVM.h.
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 298 of file SVM.cpp.
get linear term
- Parameters:
-
| len | lenght of the linear term vector (returned) |
- Returns:
- the linear term
Definition at line 331 of file SVM.cpp.
virtual const char* get_name |
( |
void |
|
) |
const [virtual] |
- Returns:
- object name
Reimplemented from CKernelMachine.
Reimplemented in CMKL, CDomainAdaptationSVM, CGMNPSVM, CGNPPSVM, CGPBTSVM, CLaRank, CLibSVM, CLibSVMMultiClass, CLibSVMOneClass, CMPDSVM, CScatterSVM, CSVMLight, CLibSVR, and CSVRLight.
Definition at line 229 of file SVM.h.
get nu
- Returns:
- nu
Definition at line 150 of file SVM.h.
get objective
- Returns:
- objective
Definition at line 213 of file SVM.h.
get qpsize
- Returns:
- qpsize
Definition at line 168 of file SVM.h.
bool get_shrinking_enabled |
( |
|
) |
|
get state of shrinking
- Returns:
- if shrinking is enabled
Definition at line 183 of file SVM.h.
get tube epsilon
- Returns:
- tube epsilon
Definition at line 132 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 113 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 237 of file SVM.cpp.
void set_defaults |
( |
int32_t |
num_sv = 0 |
) |
|
set default values for members a SVM object
Definition at line 48 of file SVM.cpp.
set epsilon
- Parameters:
-
Definition at line 120 of file SVM.h.
set linear term of the QP
- Parameters:
-
| linear_term | the linear term |
| len | lenght of the linear term vector |
Definition at line 309 of file SVM.cpp.
set nu
- Parameters:
-
Definition at line 102 of file SVM.h.
set objective
- Parameters:
-
Definition at line 204 of file SVM.h.
void set_qpsize |
( |
int32_t |
qps |
) |
|
set qpsize
- Parameters:
-
Definition at line 138 of file SVM.h.
void set_shrinking_enabled |
( |
bool |
enable |
) |
|
set state of shrinking
- Parameters:
-
| enable | if shrinking will be enabled |
Definition at line 174 of file SVM.h.
set tube epsilon
- Parameters:
-
Definition at line 126 of file SVM.h.
Member Data Documentation
C1 regularization const
Definition at line 253 of file SVM.h.
C2
Definition at line 255 of file SVM.h.
callback function svm optimizers may call when they have a new (small) set of alphas
Definition at line 265 of file SVM.h.
epsilon
Definition at line 247 of file SVM.h.
linear term in qp
Definition at line 241 of file SVM.h.
mkl object that svm optimizers need to pass when calling the callback function
Definition at line 268 of file SVM.h.
nu
Definition at line 251 of file SVM.h.
objective
Definition at line 257 of file SVM.h.
qpsize
Definition at line 259 of file SVM.h.
if SVM is loaded
Definition at line 245 of file SVM.h.
tube epsilon for support vector regression
Definition at line 249 of file SVM.h.
if shrinking shall be used
Definition at line 261 of file SVM.h.
The documentation for this class was generated from the following files: