SHOGUN
v3.0.0
Main Page
Related Pages
Modules
Classes
Files
File List
File Members
All
Classes
Namespaces
Files
Functions
Variables
Typedefs
Enumerations
Enumerator
Friends
Macros
Groups
Pages
src
shogun
kernel
string
DistantSegmentsKernel.h
Go to the documentation of this file.
1
/*
2
* This program is free software; you can redistribute it and/or modify
3
* it under the terms of the GNU General Public License as published by
4
* the Free Software Foundation; either version 3 of the License, or
5
* (at your option) any later version.
6
*
7
* Written (W) 2011 Heiko Strathmann
8
* DS-Kernel implementation Written (W) 2008 Sébastien Boisvert under GPLv3
9
* Copyright (C) 2011 Berlin Institute of Technology and Max-Planck-Society
10
*/
11
12
#ifndef DISTANTSEGMENTSKERNEL_H_
13
#define DISTANTSEGMENTSKERNEL_H_
14
15
#include <
shogun/kernel/string/StringKernel.h
>
16
17
namespace
shogun
18
{
19
34
class
CDistantSegmentsKernel
:
public
CStringKernel
<char>
35
{
36
public
:
38
CDistantSegmentsKernel
();
39
46
CDistantSegmentsKernel
(int32_t size, int32_t
delta
, int32_t theta);
47
56
CDistantSegmentsKernel
(
CStringFeatures<char>
* l,
CStringFeatures<char>
* r,
57
int32_t size, int32_t delta, int32_t theta);
58
65
virtual
bool
init
(
CFeatures
* l,
CFeatures
* r);
66
70
virtual
EKernelType
get_kernel_type
()
71
{
72
return
K_DISTANTSEGMENTS
;
73
}
74
78
virtual
const
char
*
get_name
()
const
79
{
80
return
"DistantSegmentsKernel"
;
81
}
82
83
protected
:
93
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
94
95
private
:
97
void
init();
98
103
int32_t bin(int32_t j, int32_t i);
104
118
int32_t
compute
(
char
* s, int32_t sLength,
char
* b, int32_t bLength,
119
int32_t delta_m, int32_t theta_m);
120
121
protected
:
123
int32_t
m_delta
;
124
126
int32_t
m_theta
;
127
128
129
};
130
131
}
132
133
#endif
/* DISTANTSEGMENTSKERNEL_H_ */
SHOGUN
Machine Learning Toolbox - Documentation