CSVM Class Reference
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 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 37 of file SVM.cpp.
Member Function Documentation
compute svm dual objective
- Returns:
- computed dual objective
Definition at line 223 of file SVM.cpp.
compute svm primal objective
- Returns:
- computed svm primal objective
Definition at line 248 of file SVM.cpp.
get C1
- Returns:
- C1
Definition at line 145 of file SVM.h.
get C2
- Returns:
- C2
Definition at line 151 of file SVM.h.
get epsilon
- Returns:
- epsilon
Definition at line 133 of file SVM.h.
std::vector< float64_t > get_linear_term |
( |
|
) |
[virtual] |
get linear term
- Returns:
- lin the linear term
Definition at line 305 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 275 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 218 of file SVM.h.
get nu
- Returns:
- nu
Definition at line 139 of file SVM.h.
get objective
- Returns:
- objective
Definition at line 202 of file SVM.h.
get qpsize
- Returns:
- qpsize
Definition at line 157 of file SVM.h.
bool get_shrinking_enabled |
( |
|
) |
|
get state of shrinking
- Returns:
- if shrinking is enabled
Definition at line 172 of file SVM.h.
bool load |
( |
FILE * |
svm_file |
) |
[virtual] |
bool save |
( |
FILE * |
svm_file |
) |
[virtual] |
set C
- Parameters:
-
| c1 | new C constant for negatively labelled examples |
| c2 | new C constant for positively labelled examples |
Note that not all SVMs support this (however at least CLibSVM and CSVMLight do)
Definition at line 109 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 213 of file SVM.cpp.
void set_defaults |
( |
int32_t |
num_sv = 0 |
) |
|
set default values for members a SVM object
Definition at line 51 of file SVM.cpp.
set epsilon
- Parameters:
-
Definition at line 115 of file SVM.h.
void set_linear_term |
( |
std::vector< float64_t > |
lin |
) |
[virtual] |
set linear term of the QP
- Parameters:
-
Definition at line 286 of file SVM.cpp.
set nu
- Parameters:
-
Definition at line 99 of file SVM.h.
set objective
- Parameters:
-
Definition at line 193 of file SVM.h.
void set_qpsize |
( |
int32_t |
qps |
) |
|
set qpsize
- Parameters:
-
Definition at line 127 of file SVM.h.
void set_shrinking_enabled |
( |
bool |
enable |
) |
|
set state of shrinking
- Parameters:
-
| enable | if shrinking will be enabled |
Definition at line 163 of file SVM.h.
set tube epsilon
- Parameters:
-
Definition at line 121 of file SVM.h.
Member Data Documentation
C1 regularization const
Definition at line 299 of file SVM.h.
C2
Definition at line 301 of file SVM.h.
callback function svm optimizers may call when they have a new (small) set of alphas
epsilon
Definition at line 293 of file SVM.h.
linear term in qp
Definition at line 288 of file SVM.h.
mkl object that svm optimizers need to pass when calling the callback function
Definition at line 314 of file SVM.h.
nu
Definition at line 297 of file SVM.h.
objective
Definition at line 303 of file SVM.h.
qpsize
Definition at line 305 of file SVM.h.
if SVM is loaded
Definition at line 291 of file SVM.h.
tube epsilon for support vector regression
Definition at line 295 of file SVM.h.
if shrinking shall be used
Definition at line 307 of file SVM.h.
The documentation for this class was generated from the following files: