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

CPolyMatchStringKernel类参考


详细描述

The class PolyMatchStringKernel computes a variant of the polynomial kernel on strings of same length.

It is computed as

\[ k({\bf x},{\bf x'})= (\sum_{i=0}^L I(x_i=x'_i)+c)^d \]

where I is the indicator function which evaluates to 1 if its argument is true and to 0 otherwise.

Note that additional normalisation is applied, i.e.

\[ k'({\bf x}, {\bf x'})=\frac{k({\bf x}, {\bf x'})}{\sqrt{k({\bf x}, {\bf x})k({\bf x'}, {\bf x'})}} \]

在文件PolyMatchStringKernel.h36行定义。

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

所有成员的列表。

公有成员

 CPolyMatchStringKernel (int32_t size, int32_t degree, bool inhomogene)
 CPolyMatchStringKernel (CStringFeatures< char > *l, CStringFeatures< char > *r, int32_t degree, bool inhomogene)
virtual ~CPolyMatchStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
void set_rescaling_enabled (bool n)
bool get_rescaling_enabled ()

保护成员

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

保护属性

int32_t degree
bool inhomogene
bool rescaling

构造及析构函数文档

CPolyMatchStringKernel ( int32_t  size,
int32_t  degree,
bool  inhomogene 
)

constructor

参数:
sizecache size
degreedegree
inhomogeneis inhomogeneous

在文件PolyMatchStringKernel.cpp20行定义。

CPolyMatchStringKernel ( CStringFeatures< char > *  l,
CStringFeatures< char > *  r,
int32_t  degree,
bool  inhomogene 
)

constructor

参数:
lfeatures of left-hand side
rfeatures of right-hand side
degreedegree
inhomogeneis inhomogeneous

在文件PolyMatchStringKernel.cpp26行定义。

~CPolyMatchStringKernel (  ) [virtual]

在文件PolyMatchStringKernel.cpp34行定义。


成员函数文档

void cleanup (  ) [virtual]

clean up kernel

重载CKernel

在文件PolyMatchStringKernel.cpp45行定义。

float64_t compute ( int32_t  idx_a,
int32_t  idx_b 
) [protected, virtual]

compute kernel function for features a and b idx_{a,b} denote the index of the feature vectors in the corresponding feature object

参数:
idx_aindex a
idx_bindex b
返回:
computed kernel function at indices a,b

实现了CKernel

在文件PolyMatchStringKernel.cpp50行定义。

virtual EKernelType get_kernel_type (  ) [virtual]

return what type of kernel we are

返回:
kernel type POLYMATCH

实现了CKernel

在文件PolyMatchStringKernel.h75行定义。

virtual const char* get_name (  ) const [virtual]

return the kernel's name

返回:
name PolyMatchString

实现了CSGObject

在文件PolyMatchStringKernel.h84行定义。

bool get_rescaling_enabled (  )

在文件PolyMatchStringKernel.h95行定义。

bool init ( CFeatures l,
CFeatures r 
) [virtual]

initialize kernel

参数:
lfeatures of left-hand side
rfeatures of right-hand side
返回:
if initializing was successful

重载CStringKernel< char >

在文件PolyMatchStringKernel.cpp39行定义。

void set_rescaling_enabled ( bool  n )

enable rescaling by length of feature vector

参数:
ntrue to enable

在文件PolyMatchStringKernel.h90行定义。


成员数据文档

int32_t degree [protected]

degree

在文件PolyMatchStringKernel.h113行定义。

bool inhomogene [protected]

if kernel is inhomogeneous

在文件PolyMatchStringKernel.h115行定义。

bool rescaling [protected]

true to rescale kernel with string length

在文件PolyMatchStringKernel.h117行定义。


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

SHOGUN Machine Learning Toolbox - Documentation