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.

Public Member Functions | |
| CDistantSegmentsKernel () | |
| 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 |
default constructor
Definition at line 17 of file DistantSegmentsKernel.cpp.
| CDistantSegmentsKernel | ( | int32_t | size, | |
| int32_t | delta, | |||
| int32_t | theta | |||
| ) |
constructor
| size | cache size | |
| delta |
-parameter of the DS-kernel | |
| 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
| l | features of left-side | |
| r | features of right-side | |
| size | cache size | |
| delta |
-parameter of the DS-kernel | |
| theta |
-parameter of the DS-kernel |
Definition at line 29 of file DistantSegmentsKernel.cpp.
| 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_a | index a | |
| idx_b | index b |
Implements CKernel.
Definition at line 49 of file DistantSegmentsKernel.cpp.
| virtual EKernelType get_kernel_type | ( | ) | [virtual] |
Implements CStringKernel< char >.
Definition at line 70 of file DistantSegmentsKernel.h.
| virtual const char* get_name | ( | ) | const [virtual] |
Reimplemented from CStringKernel< char >.
Definition at line 78 of file DistantSegmentsKernel.h.
initialize kernel with features
| l | features of left-side | |
| r | features of right-side |
Reimplemented from CStringKernel< char >.
Definition at line 37 of file DistantSegmentsKernel.cpp.
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.