SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
MatchWordStringKernel.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) 1999-2009 Soeren Sonnenburg
8  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
9  */
10 
11 #ifndef _MATCHWORDSTRINGKERNEL_H___
12 #define _MATCHWORDSTRINGKERNEL_H___
13 
14 #include <shogun/lib/config.h>
15 
16 #include <shogun/lib/common.h>
19 
20 namespace shogun
21 {
39 class CMatchWordStringKernel: public CStringKernel<uint16_t>
40 {
41  public:
44 
50  CMatchWordStringKernel(int32_t size, int32_t d);
51 
59 
60  virtual ~CMatchWordStringKernel();
61 
68  virtual bool init(CFeatures* l, CFeatures* r);
69 
74  virtual EKernelType get_kernel_type() { return K_MATCHWORD; }
75 
80  virtual const char* get_name() const { return "MatchWordStringKernel"; }
81 
82  protected:
91  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
92 
93  private:
94  void init();
95 
96  protected:
98  int32_t degree;
99 };
100 }
101 #endif /* _MATCHWORDSTRINGKERNEL_H__ */
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
EKernelType
Definition: Kernel.h:57
virtual const char * get_name() const
double float64_t
Definition: common.h:50
The class MatchWordStringKernel computes a variant of the polynomial kernel on strings of same length...
virtual EKernelType get_kernel_type()
virtual bool init(CFeatures *l, CFeatures *r)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
The class Features is the base class of all feature objects.
Definition: Features.h:68
Template class StringKernel, is the base class of all String Kernels.
Definition: StringKernel.h:26

SHOGUN 机器学习工具包 - 项目文档