SHOGUN v0.9.0
公有成员 | 保护成员 | 保护属性
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.h46行定义。

继承图,类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 float64_tget_linear_term_ptr (index_t *len)
virtual void set_linear_term (float64_t *linear_term, index_t len)
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 ()

保护属性

float64_tm_linear_term
index_t m_linear_term_len
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

构造及析构函数文档

CSVM ( int32_t  num_sv = 0)

Create an empty Support Vector Machine Object

参数:
num_svwith num_sv support vectors

在文件SVM.cpp27行定义。

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.cpp33行定义。

~CSVM ( ) [virtual]

在文件SVM.cpp42行定义。


成员函数文档

float64_t compute_svm_dual_objective ( )

compute svm dual objective

返回:
computed dual objective

在文件SVM.cpp247行定义。

float64_t compute_svm_primal_objective ( )

compute svm primal objective

返回:
computed svm primal objective

在文件SVM.cpp272行定义。

float64_t get_C1 ( )

get C1

返回:
C1

在文件SVM.h156行定义。

float64_t get_C2 ( )

get C2

返回:
C2

在文件SVM.h162行定义。

float64_t get_epsilon ( )

get epsilon

返回:
epsilon

在文件SVM.h144行定义。

float64_t * get_linear_term_array ( ) [protected, virtual]

get linear term copy as dynamic array

返回:
linear term copied to a dynamic array

在文件SVM.cpp298行定义。

float64_t * get_linear_term_ptr ( index_t len) [virtual]

get linear term

参数:
lenlenght of the linear term vector (returned)
返回:
the linear term

在文件SVM.cpp331行定义。

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

重载CKernelMachine

CMKLCGMNPSVMCGNPPSVMCGPBTSVMCLaRankCLibSVMCLibSVMMultiClassCLibSVMOneClassCMPDSVMCScatterSVMCLibSVR重载。

在文件SVM.h229行定义。

float64_t get_nu ( )

get nu

返回:
nu

在文件SVM.h150行定义。

float64_t get_objective ( )

get objective

返回:
objective

在文件SVM.h213行定义。

int32_t get_qpsize ( )

get qpsize

返回:
qpsize

在文件SVM.h168行定义。

bool get_shrinking_enabled ( )

get state of shrinking

返回:
if shrinking is enabled

在文件SVM.h183行定义。

float64_t get_tube_epsilon ( )

get tube epsilon

返回:
tube epsilon

在文件SVM.h132行定义。

bool load ( FILE *  svm_file) [virtual]

load a SVM from file

参数:
svm_filethe file handle

重载CClassifier

CMultiClassSVM重载。

在文件SVM.cpp95行定义。

bool save ( FILE *  svm_file) [virtual]

write a SVM to a file

参数:
svm_filethe file handle

重载CClassifier

CMultiClassSVM重载。

在文件SVM.cpp211行定义。

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.h113行定义。

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.cpp237行定义。

void set_defaults ( int32_t  num_sv = 0)

set default values for members a SVM object

在文件SVM.cpp48行定义。

void set_epsilon ( float64_t  eps)

set epsilon

参数:
epsnew epsilon

在文件SVM.h120行定义。

void set_linear_term ( float64_t linear_term,
index_t  len 
) [virtual]

set linear term of the QP

参数:
linear_termthe linear term
lenlenght of the linear term vector

在文件SVM.cpp309行定义。

void set_nu ( float64_t  nue)

set nu

参数:
nuenew nu

在文件SVM.h102行定义。

void set_objective ( float64_t  v)

set objective

参数:
vobjective

在文件SVM.h204行定义。

void set_qpsize ( int32_t  qps)

set qpsize

参数:
qpsnew qpsize

在文件SVM.h138行定义。

void set_shrinking_enabled ( bool  enable)

set state of shrinking

参数:
enableif shrinking will be enabled

在文件SVM.h174行定义。

void set_tube_epsilon ( float64_t  eps)

set tube epsilon

参数:
epsnew tube epsilon

在文件SVM.h126行定义。


成员数据文档

float64_t C1 [protected]

C1 regularization const

在文件SVM.h253行定义。

float64_t C2 [protected]

C2

在文件SVM.h255行定义。

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.h265行定义。

float64_t epsilon [protected]

epsilon

在文件SVM.h247行定义。

float64_t* m_linear_term [protected]

linear term in qp

在文件SVM.h241行定义。

在文件SVM.h242行定义。

CMKL* mkl [protected]

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

在文件SVM.h268行定义。

float64_t nu [protected]

nu

在文件SVM.h251行定义。

float64_t objective [protected]

objective

在文件SVM.h257行定义。

int32_t qpsize [protected]

qpsize

在文件SVM.h259行定义。

bool svm_loaded [protected]

if SVM is loaded

在文件SVM.h245行定义。

float64_t tube_epsilon [protected]

tube epsilon for support vector regression

在文件SVM.h249行定义。

bool use_shrinking [protected]

if shrinking shall be used

在文件SVM.h261行定义。


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

SHOGUN Machine Learning Toolbox - Documentation