Public Member Functions | Protected Member Functions | Protected Attributes

CDistantSegmentsKernel Class Reference


Detailed Description

The distant segments kernel is a string kernel, which counts the number of substrings, so-called segments, at a certain distance from each other.

The implementation is taken from http://www.retrovirology.com/content/5/1/110/ and only adjusted to work with shogun. See that page for any details.

Reference: Sebastien Boisvert, Mario Marchand, Francois Laviolette, and Jacques Corbeil. Hiv-1 coreceptor usage prediction without multiple alignments: an application of string kernels. Retrovirology, 5(1):110, Dec 2008.

Definition at line 34 of file DistantSegmentsKernel.h.

Inheritance diagram for CDistantSegmentsKernel:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CDistantSegmentsKernel (void)
 CDistantSegmentsKernel (int32_t size, int32_t delta, int32_t theta)
 CDistantSegmentsKernel (CStringFeatures< char > *l, CStringFeatures< char > *r, int32_t size, int32_t delta, int32_t theta)
virtual bool init (CFeatures *l, CFeatures *r)
virtual EKernelType get_kernel_type ()
virtual const char * get_name () const

Protected Member Functions

virtual float64_t compute (int32_t idx_a, int32_t idx_b)

Protected Attributes

int32_t m_delta
int32_t m_theta

Constructor & Destructor Documentation

CDistantSegmentsKernel ( void   ) 

default constructor

Definition at line 17 of file DistantSegmentsKernel.cpp.

CDistantSegmentsKernel ( int32_t  size,
int32_t  delta,
int32_t  theta 
)

constructor

Parameters:
size cache size
delta 

\[\delta\]

-parameter of the DS-kernel

theta 

\[\theta\]

-parameter of the DS-kernel

Definition at line 23 of file DistantSegmentsKernel.cpp.

CDistantSegmentsKernel ( CStringFeatures< char > *  l,
CStringFeatures< char > *  r,
int32_t  size,
int32_t  delta,
int32_t  theta 
)

constructor

Parameters:
l features of left-side
r features of right-side
size cache size
delta 

\[\delta\]

-parameter of the DS-kernel

theta 

\[\theta\]

-parameter of the DS-kernel

Definition at line 29 of file DistantSegmentsKernel.cpp.


Member Function Documentation

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

Parameters:
idx_a index a
idx_b index b
Returns:
computed kernel function at indices a,b

Implements CKernel.

Definition at line 49 of file DistantSegmentsKernel.cpp.

virtual EKernelType get_kernel_type (  )  [virtual]
Returns:
kernel type

Implements CStringKernel< char >.

Definition at line 70 of file DistantSegmentsKernel.h.

virtual const char* get_name ( void   )  const [virtual]
Returns:
name of kernel

Reimplemented from CStringKernel< char >.

Definition at line 78 of file DistantSegmentsKernel.h.

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

initialize kernel with features

Parameters:
l features of left-side
r features of right-side
Returns:
true if successful

Reimplemented from CStringKernel< char >.

Definition at line 37 of file DistantSegmentsKernel.cpp.


Member Data Documentation

int32_t m_delta [protected]

delta parameter of DS-kernel

Definition at line 123 of file DistantSegmentsKernel.h.

int32_t m_theta [protected]

theta parameter of DS-kernel

Definition at line 126 of file DistantSegmentsKernel.h.


The documentation for this class was generated from the following files:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation