SHOGUN
3.2.1
首页
相关页面
模块
类
文件
文件列表
文件成员
全部
类
命名空间
文件
函数
变量
类型定义
枚举
枚举值
友元
宏定义
组
页
src
shogun
kernel
string
SubsequenceStringKernel.h
浏览该文件的文档.
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) 2014 Soumyajit De
8
*/
9
10
#ifndef SUBSEQUENCE_STRING_KERNEL_H_
11
#define SUBSEQUENCE_STRING_KERNEL_H_
12
13
#include <
shogun/lib/common.h
>
14
#include <
shogun/kernel/string/StringKernel.h
>
15
16
namespace
shogun
17
{
53
class
CSubsequenceStringKernel
:
public
CStringKernel
<char>
54
{
55
public
:
57
CSubsequenceStringKernel
();
58
66
CSubsequenceStringKernel
(int32_t size, int32_t maxlen,
float64_t
lambda);
67
76
CSubsequenceStringKernel
(
CStringFeatures<char>
*
lhs
,
CStringFeatures<char>
*
rhs
,
77
int32_t maxlen,
float64_t
lambda);
78
80
virtual
~CSubsequenceStringKernel
();
81
89
virtual
bool
init
(
CFeatures
* lhs,
CFeatures
* rhs);
90
92
virtual
void
cleanup
();
93
95
virtual
EKernelType
get_kernel_type
()
96
{
97
return
K_POLYMATCH
;
98
}
99
101
virtual
const
char
*
get_name
()
const
102
{
103
return
"SubsequenceStringKernel"
;
104
}
105
107
virtual
void
register_params
();
108
131
virtual
float64_t
compute
(int32_t idx_a, int32_t idx_b);
132
133
protected
:
135
int32_t
m_maxlen
;
136
138
float64_t
m_lambda
;
139
};
140
141
}
142
#endif // SUBSEQUENCE_STRING_KERNEL_H_
SHOGUN
机器学习工具包 - 项目文档