SHOGUN v0.9.0
公有成员 | 静态公有成员 | 保护属性
CKernelMachine类参考

详细描述

A generic KernelMachine interface.

A kernel 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 in a training procedure.

在文件KernelMachine.h43行定义。

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

所有成员的列表。

公有成员

 CKernelMachine ()
virtual ~CKernelMachine ()
virtual const char * get_name (void) const
void set_kernel (CKernel *k)
CKernelget_kernel ()
void set_batch_computation_enabled (bool enable)
bool get_batch_computation_enabled ()
void set_linadd_enabled (bool enable)
bool get_linadd_enabled ()
void set_bias_enabled (bool enable_bias)
bool get_bias_enabled ()
float64_t get_bias ()
void set_bias (float64_t bias)
int32_t get_support_vector (int32_t idx)
float64_t get_alpha (int32_t idx)
bool set_support_vector (int32_t idx, int32_t val)
bool set_alpha (int32_t idx, float64_t val)
int32_t get_num_support_vectors ()
void set_alphas (float64_t *alphas, int32_t d)
void set_support_vectors (int32_t *svs, int32_t d)
void get_support_vectors (int32_t **svs, int32_t *num)
void get_alphas (float64_t **alphas, int32_t *d1)
bool create_new_model (int32_t num)
bool init_kernel_optimization ()
virtual CLabelsclassify ()
virtual CLabelsclassify (CFeatures *data)
virtual float64_t classify_example (int32_t num)

静态公有成员

static void * classify_example_helper (void *p)

保护属性

CKernelkernel
bool use_batch_computation
bool use_linadd
bool use_bias
float64_t m_bias
float64_tm_alpha
int32_t * m_svs
int32_t num_svs

构造及析构函数文档

default constructor

在文件KernelMachine.cpp30行定义。

~CKernelMachine ( ) [virtual]

destructor

在文件KernelMachine.cpp53行定义。


成员函数文档

CLabels * classify ( ) [virtual]

classify kernel machine

返回:
result labels

实现了CClassifier

CMultiClassSVMCKRR重载。

在文件KernelMachine.cpp92行定义。

CLabels * classify ( CFeatures data) [virtual]

classify objects

参数:
data(test)data to be classified
返回:
classified labels

实现了CClassifier

CKRR重载。

在文件KernelMachine.cpp231行定义。

float64_t classify_example ( int32_t  num) [virtual]

classify one example

参数:
numwhich example to classify
返回:
classified value

重载CClassifier

CKernelPerceptronCMultiClassSVMCScatterSVMCKRR重载。

在文件KernelMachine.cpp211行定义。

void * classify_example_helper ( void *  p) [static]

classify example helper, used in threads

参数:
pparams of the thread
返回:
nothing really

在文件KernelMachine.cpp248行定义。

bool create_new_model ( int32_t  num)

create new model

参数:
numnumber of alphas and support vectors in new model

在文件KernelMachine.h286行定义。

float64_t get_alpha ( int32_t  idx)

get alpha at given index

参数:
idxindex of alpha
返回:
alpha

在文件KernelMachine.h163行定义。

void get_alphas ( float64_t **  alphas,
int32_t *  d1 
)

get all alphas (swig compatible)

参数:
alphasarray to contain a copy of the alphas
d1number of alphas in the array

在文件KernelMachine.h266行定义。

bool get_batch_computation_enabled ( )

check if batch computation is enabled

返回:
if batch computation is enabled

在文件KernelMachine.h94行定义。

float64_t get_bias ( )

get bias

返回:
bias

在文件KernelMachine.h133行定义。

bool get_bias_enabled ( )

get state of bias

返回:
state of bias

在文件KernelMachine.h127行定义。

CKernel* get_kernel ( )

get kernel

返回:
kernel

在文件KernelMachine.h75行定义。

bool get_linadd_enabled ( )

check if linadd is enabled

返回:
if linadd is enabled

在文件KernelMachine.h112行定义。

virtual const char* get_name ( void  ) const [virtual]

Returns the name of the SGSerializable instance. It MUST BE the CLASS NAME without the prefixed `C'.

返回:
name of the SGSerializable

实现了CSGObject

CKernelPerceptronCMKLCGMNPSVMCGNPPSVMCGPBTSVMCLaRankCLibSVMCLibSVMMultiClassCLibSVMOneClassCMPDSVMCScatterSVMCSVMCKRRCLibSVR重载。

在文件KernelMachine.h57行定义。

int32_t get_num_support_vectors ( )

get number of support vectors

返回:
number of support vectors

在文件KernelMachine.h205行定义。

int32_t get_support_vector ( int32_t  idx)

get support vector at given index

参数:
idxindex of support vector
返回:
support vector

在文件KernelMachine.h152行定义。

void get_support_vectors ( int32_t **  svs,
int32_t *  num 
)

get all support vectors (swig compatible)

参数:
svsarray to contain a copy of the support vectors
numnumber of support vectors in the array

在文件KernelMachine.h245行定义。

bool init_kernel_optimization ( )

initialise kernel optimisation

返回:
if operation was successful

在文件KernelMachine.cpp61行定义。

bool set_alpha ( int32_t  idx,
float64_t  val 
)

set alpha at given index to given value

参数:
idxindex of alpha vector
valnew value of alpha vector
返回:
if operation was successful

在文件KernelMachine.h191行定义。

void set_alphas ( float64_t alphas,
int32_t  d 
)

set alphas to given values

参数:
alphasarray with all alphas to set
dnumber of alphas (== number of support vectors)

在文件KernelMachine.h215行定义。

void set_batch_computation_enabled ( bool  enable)

set batch computation enabled

参数:
enableif batch computation shall be enabled

在文件KernelMachine.h85行定义。

void set_bias ( float64_t  bias)

set bias to given value

参数:
biasnew bias

在文件KernelMachine.h142行定义。

void set_bias_enabled ( bool  enable_bias)

set state of bias

参数:
enable_biasif bias shall be enabled

在文件KernelMachine.h121行定义。

void set_kernel ( CKernel k)

set kernel

参数:
kkernel

在文件KernelMachine.h64行定义。

void set_linadd_enabled ( bool  enable)

set linadd enabled

参数:
enableif linadd shall be enabled

在文件KernelMachine.h103行定义。

bool set_support_vector ( int32_t  idx,
int32_t  val 
)

set support vector at given index to given value

参数:
idxindex of support vector
valnew value of support vector
返回:
if operation was successful

在文件KernelMachine.h175行定义。

void set_support_vectors ( int32_t *  svs,
int32_t  d 
)

set support vectors to given values

参数:
svsarray with all support vectors to set
dnumber of support vectors

在文件KernelMachine.h230行定义。


成员数据文档

CKernel* kernel [protected]

kernel

在文件KernelMachine.h343行定义。

float64_t* m_alpha [protected]

array of coefficients alpha

在文件KernelMachine.h353行定义。

float64_t m_bias [protected]

bias term b

在文件KernelMachine.h351行定义。

int32_t* m_svs [protected]

array of ``support vectors''

在文件KernelMachine.h355行定义。

int32_t num_svs [protected]

number of ``support vectors''

在文件KernelMachine.h357行定义。

bool use_batch_computation [protected]

if batch computation is enabled

在文件KernelMachine.h345行定义。

bool use_bias [protected]

if bias shall be used

在文件KernelMachine.h349行定义。

bool use_linadd [protected]

if linadd is enabled

在文件KernelMachine.h347行定义。


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

SHOGUN Machine Learning Toolbox - Documentation