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

CWeightedCommWordStringKernel类参考


详细描述

The WeightedCommWordString kernel may be used to compute the weighted spectrum kernel (i.e. a spectrum kernel for 1 to K-mers, where each k-mer length is weighted by some coefficient $\beta_k$) from strings that have been mapped into unsigned 16bit integers.

These 16bit integers correspond to k-mers. To applicable in this kernel they need to be sorted (e.g. via the SortWordString pre-processor).

It basically uses the algorithm in the unix "comm" command (hence the name) to compute:

\[ k({\bf x},({\bf x'})= \sum_{k=1}^K\beta_k\Phi_k({\bf x})\cdot \Phi_k({\bf x'}) \]

where $\Phi_k$ maps a sequence ${\bf x}$ that consists of letters in $\Sigma$ to a feature vector of size $|\Sigma|^k$. In this feature vector each entry denotes how often the k-mer appears in that ${\bf x}$.

Note that this representation is especially tuned to small alphabets (like the 2-bit alphabet DNA), for which it enables spectrum kernels of order 8.

For this kernel the linadd speedups are quite efficiently implemented using direct maps.

在文件WeightedCommWordStringKernel.h50行定义。

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

所有成员的列表。

公有成员

 CWeightedCommWordStringKernel (int32_t size, bool use_sign)
 CWeightedCommWordStringKernel (CStringFeatures< uint16_t > *l, CStringFeatures< uint16_t > *r, bool use_sign=false, int32_t size=10)
virtual ~CWeightedCommWordStringKernel ()
virtual bool init (CFeatures *l, CFeatures *r)
virtual void cleanup ()
virtual float64_t compute_optimized (int32_t idx)
virtual void add_to_normal (int32_t idx, float64_t weight)
void merge_normal ()
bool set_wd_weights ()
bool set_weights (float64_t *w, int32_t d)
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const
virtual EFeatureType get_feature_type ()
virtual float64_tcompute_scoring (int32_t max_degree, int32_t &num_feat, int32_t &num_sym, float64_t *target, int32_t num_suppvec, int32_t *IDX, float64_t *alphas, bool do_init=true)

保护成员

virtual float64_t compute_helper (int32_t idx_a, int32_t idx_b, bool do_sort)

保护属性

int32_t degree
float64_tweights

构造及析构函数文档

CWeightedCommWordStringKernel ( int32_t  size,
bool  use_sign 
)

constructor

参数:
size cache size
use_sign if sign shall be used

在文件WeightedCommWordStringKernel.cpp18行定义。

CWeightedCommWordStringKernel ( CStringFeatures< uint16_t > *  l,
CStringFeatures< uint16_t > *  r,
bool  use_sign = false,
int32_t  size = 10 
)

constructor

参数:
l features of left-hand side
r features of right-hand side
use_sign if sign shall be used
size cache size

在文件WeightedCommWordStringKernel.cpp26行定义。

~CWeightedCommWordStringKernel (  )  [virtual]

在文件WeightedCommWordStringKernel.cpp37行定义。


成员函数文档

void add_to_normal ( int32_t  idx,
float64_t  weight 
) [virtual]

add to normal

参数:
idx where to add
weight what to add

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.cpp185行定义。

void cleanup (  )  [virtual]

clean up kernel

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.cpp53行定义。

float64_t compute_helper ( int32_t  idx_a,
int32_t  idx_b,
bool  do_sort 
) [protected, virtual]

helper for compute

参数:
idx_a index a
idx_b index b
do_sort if sorting shall be performed

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.cpp90行定义。

float64_t compute_optimized ( int32_t  idx  )  [virtual]

compute optimized

参数:
idx index to compute
返回:
optimized value at given index

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.cpp247行定义。

float64_t * compute_scoring ( int32_t  max_degree,
int32_t &  num_feat,
int32_t &  num_sym,
float64_t target,
int32_t  num_suppvec,
int32_t *  IDX,
float64_t alphas,
bool  do_init = true 
) [virtual]

compute scoring

参数:
max_degree maximum degree
num_feat number of features
num_sym number of symbols
target target
num_suppvec number of support vectors
IDX IDX
alphas alphas
do_init if initialization shall be performed
返回:
computed score

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.cpp282行定义。

virtual EFeatureType get_feature_type (  )  [virtual]

return feature type the kernel can deal with

返回:
feature type WORD

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.h131行定义。

virtual EKernelType get_kernel_type (  )  [virtual]

return what type of kernel we are

返回:
kernel type WEIGHTEDCOMMWORDSTRING

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.h119行定义。

virtual const char* get_name (  )  const [virtual]

return the kernel's name

返回:
name WeightedCommWordString

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.h125行定义。

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

initialize kernel

参数:
l features of left-hand side
r features of right-hand side
返回:
if initializing was successful

重载CCommWordStringKernel

在文件WeightedCommWordStringKernel.cpp42行定义。

void merge_normal (  ) 

merge normal

在文件WeightedCommWordStringKernel.cpp215行定义。

bool set_wd_weights (  ) 

set weighted degree weights

返回:
if setting was successful

在文件WeightedCommWordStringKernel.cpp61行定义。

bool set_weights ( float64_t w,
int32_t  d 
)

set custom weights (swig compatible)

参数:
w weights
d degree (must match number of weights)
返回:
if setting was successful

在文件WeightedCommWordStringKernel.cpp79行定义。


成员数据文档

int32_t degree [protected]

degree

在文件WeightedCommWordStringKernel.h161行定义。

float64_t* weights [protected]

weights for each of the subkernels of degree 1...d

在文件WeightedCommWordStringKernel.h164行定义。


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

SHOGUN Machine Learning Toolbox - Documentation