公有成员 | 保护成员 | 保护属性

CSVM类参考


详细描述

A generic Support Vector Machine Interface.

A support vector machine is defined as

\[ f({\bf x})=\sum_{i=0}^{N-1} \alpha_i k({\bf x}, {\bf x_i})+b \]

where $N$ is the number of training examples $\alpha_i$ are the weights assigned to each training example $k(x,x')$ is the kernel and $b$ the bias.

Using an a-priori choosen kernel, the $\alpha_i$ and bias are determined by solving the following quadratic program

\begin{eqnarray*} \max_{\bf \alpha} && \sum_{i=0}^{N-1} \alpha_i - \sum_{i=0}^{N-1}\sum_{j=0}^{N-1} \alpha_i y_i \alpha_j y_j k({\bf x_i}, {\bf x_j})\\ \mbox{s.t.} && 0\leq\alpha_i\leq C\\ && \sum_{i=0}^{N-1} \alpha_i y_i=0\\ \end{eqnarray*}

here C is a pre-specified regularization parameter.

在文件SVM.h47行定义。

继承图,类CSVM
Inheritance graph
[图例]

所有成员的列表。

公有成员

 CSVM (int32_t num_sv=0)
 CSVM (float64_t C, CKernel *k, CLabels *lab)
virtual ~CSVM ()
void set_defaults (int32_t num_sv=0)
virtual std::vector< float64_tget_linear_term ()
virtual void set_linear_term (std::vector< float64_t > lin)
bool load (FILE *svm_file)
bool save (FILE *svm_file)
void set_nu (float64_t nue)
void set_C (float64_t c_neg, float64_t c_pos)
void set_epsilon (float64_t eps)
void set_tube_epsilon (float64_t eps)
float64_t get_tube_epsilon ()
void set_qpsize (int32_t qps)
float64_t get_epsilon ()
float64_t get_nu ()
float64_t get_C1 ()
float64_t get_C2 ()
int32_t get_qpsize ()
void set_shrinking_enabled (bool enable)
bool get_shrinking_enabled ()
float64_t compute_svm_dual_objective ()
float64_t compute_svm_primal_objective ()
void set_objective (float64_t v)
float64_t get_objective ()
void set_callback_function (CMKL *m, bool(*cb)(CMKL *mkl, const float64_t *sumw, const float64_t suma))
virtual const char * get_name () const

保护成员

virtual float64_tget_linear_term_array ()

保护属性

std::vector< float64_tlinear_term
bool svm_loaded
float64_t epsilon
float64_t tube_epsilon
float64_t nu
float64_t C1
float64_t C2
float64_t objective
int32_t qpsize
bool use_shrinking
bool(* callback )(CMKL *mkl, const float64_t *sumw, const float64_t suma)
CMKLmkl
CParameter parameters

构造及析构函数文档

CSVM ( int32_t  num_sv = 0 )

Create an empty Support Vector Machine Object

参数:
num_svwith num_sv support vectors

在文件SVM.cpp31行定义。

CSVM ( float64_t  C,
CKernel k,
CLabels lab 
)

Create a Support Vector Machine Object from a trained SVM

参数:
Cthe C parameter
kthe Kernel object
labthe Label object

在文件SVM.cpp40行定义。

~CSVM (  ) [virtual]

在文件SVM.cpp52行定义。


成员函数文档

float64_t compute_svm_dual_objective (  )

compute svm dual objective

返回:
computed dual objective

在文件SVM.cpp229行定义。

float64_t compute_svm_primal_objective (  )

compute svm primal objective

返回:
computed svm primal objective

在文件SVM.cpp254行定义。

float64_t get_C1 (  )

get C1

返回:
C1

在文件SVM.h154行定义。

float64_t get_C2 (  )

get C2

返回:
C2

在文件SVM.h160行定义。

float64_t get_epsilon (  )

get epsilon

返回:
epsilon

在文件SVM.h142行定义。

std::vector< float64_t > get_linear_term (  ) [virtual]

get linear term

返回:
lin the linear term

在文件SVM.cpp311行定义。

float64_t * get_linear_term_array (  ) [protected, virtual]

get linear term copy as dynamic array

返回:
linear term copied to a dynamic array

在文件SVM.cpp281行定义。

virtual const char* get_name (  ) const [virtual]
返回:
object name

实现了CSGObject

CMKLCGMNPSVMCGNPPSVMCGPBTSVMCLaRankCLibSVMCLibSVMMultiClassCLibSVMOneClassCMPDSVMCScatterSVMCLibSVR重载。

在文件SVM.h227行定义。

float64_t get_nu (  )

get nu

返回:
nu

在文件SVM.h148行定义。

float64_t get_objective (  )

get objective

返回:
objective

在文件SVM.h211行定义。

int32_t get_qpsize (  )

get qpsize

返回:
qpsize

在文件SVM.h166行定义。

bool get_shrinking_enabled (  )

get state of shrinking

返回:
if shrinking is enabled

在文件SVM.h181行定义。

float64_t get_tube_epsilon (  )

get tube epsilon

返回:
tube epsilon

在文件SVM.h130行定义。

bool load ( FILE *  svm_file ) [virtual]

load a SVM from file

参数:
svm_filethe file handle

重载CClassifier

CMultiClassSVM重载。

在文件SVM.cpp83行定义。

bool save ( FILE *  svm_file ) [virtual]

write a SVM to a file

参数:
svm_filethe file handle

重载CClassifier

CMultiClassSVM重载。

在文件SVM.cpp196行定义。

void set_C ( float64_t  c_neg,
float64_t  c_pos 
)

set C

参数:
c_negnew C constant for negatively labeled examples
c_posnew C constant for positively labeled examples

Note that not all SVMs support this (however at least CLibSVM and CSVMLight do)

在文件SVM.h111行定义。

void set_callback_function ( CMKL m,
bool(*)(CMKL *mkl, const float64_t *sumw, const float64_t suma)  cb 
)

set callback function svm optimizers may call when they have a new (small) set of alphas

参数:
mpointer to mkl object
cbcallback function

在文件SVM.cpp219行定义。

void set_defaults ( int32_t  num_sv = 0 )

set default values for members a SVM object

在文件SVM.cpp57行定义。

void set_epsilon ( float64_t  eps )

set epsilon

参数:
epsnew epsilon

在文件SVM.h118行定义。

void set_linear_term ( std::vector< float64_t lin ) [virtual]

set linear term of the QP

参数:
linthe linear term

在文件SVM.cpp292行定义。

void set_nu ( float64_t  nue )

set nu

参数:
nuenew nu

在文件SVM.h100行定义。

void set_objective ( float64_t  v )

set objective

参数:
vobjective

在文件SVM.h202行定义。

void set_qpsize ( int32_t  qps )

set qpsize

参数:
qpsnew qpsize

在文件SVM.h136行定义。

void set_shrinking_enabled ( bool  enable )

set state of shrinking

参数:
enableif shrinking will be enabled

在文件SVM.h172行定义。

void set_tube_epsilon ( float64_t  eps )

set tube epsilon

参数:
epsnew tube epsilon

在文件SVM.h124行定义。


成员数据文档

float64_t C1 [protected]

C1 regularization const

在文件SVM.h308行定义。

float64_t C2 [protected]

C2

在文件SVM.h310行定义。

bool(* callback)(CMKL *mkl, const float64_t *sumw, const float64_t suma) [protected]

callback function svm optimizers may call when they have a new (small) set of alphas

在文件SVM.h320行定义。

float64_t epsilon [protected]

epsilon

在文件SVM.h302行定义。

std::vector<float64_t> linear_term [protected]

linear term in qp

在文件SVM.h297行定义。

CMKL* mkl [protected]

mkl object that svm optimizers need to pass when calling the callback function

在文件SVM.h323行定义。

float64_t nu [protected]

nu

在文件SVM.h306行定义。

float64_t objective [protected]

objective

在文件SVM.h312行定义。

CParameter parameters [protected]

在文件SVM.h325行定义。

int32_t qpsize [protected]

qpsize

在文件SVM.h314行定义。

bool svm_loaded [protected]

if SVM is loaded

在文件SVM.h300行定义。

float64_t tube_epsilon [protected]

tube epsilon for support vector regression

在文件SVM.h304行定义。

bool use_shrinking [protected]

if shrinking shall be used

在文件SVM.h316行定义。


该类的文档由以下文件生成:

SHOGUN Machine Learning Toolbox - Documentation