SHOGUN  4.1.0
 全部  命名空间 文件 函数 变量 类型定义 枚举 枚举值 友元 宏定义  
HistogramWordStringKernel.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  * Written (W) 1999-2008 Gunnar Raetsch
9  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
11 
12 #ifndef _HISTOGRAMWORDKERNEL_H___
13 #define _HISTOGRAMWORDKERNEL_H___
14 
15 #include <shogun/lib/config.h>
16 
17 #include <shogun/lib/common.h>
21 
22 namespace shogun
23 {
24  class CPluginEstimate;
25  template <class T> class CStringFeatures;
29 {
30  public:
33 
39  CHistogramWordStringKernel(int32_t size, CPluginEstimate* pie);
40 
49  CPluginEstimate* pie);
50 
52 
59  virtual bool init(CFeatures* l, CFeatures* r);
60 
62  virtual void cleanup();
63 
68  virtual EKernelType get_kernel_type() { return K_HISTOGRAM; }
69 
74  virtual const char* get_name() const { return "HistogramWordStringKernel" ; }
75 
76  protected:
85  float64_t compute(int32_t idx_a, int32_t idx_b);
86 
93  inline int32_t compute_index(int32_t position, uint16_t symbol)
94  {
95  return position*num_symbols+symbol+1;
96  }
97 
98  private:
99  void init();
100 
101  protected:
104 
109 
114 
119 
124 
126  int32_t num_params;
128  int32_t num_params2;
130  int32_t num_symbols;
133 
136 };
137 }
138 #endif /* _HISTOGRAMWORDKERNEL_H__ */
EKernelType
Definition: Kernel.h:57
The HistogramWordString computes the TOP kernel on inhomogeneous Markov Chains.
double float64_t
Definition: common.h:50
virtual bool init(CFeatures *l, CFeatures *r)
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:18
virtual const char * get_name() const
The class Features is the base class of all feature objects.
Definition: Features.h:68
class PluginEstimate
float64_t compute(int32_t idx_a, int32_t idx_b)
int32_t compute_index(int32_t position, uint16_t symbol)
Template class StringKernel, is the base class of all String Kernels.
Definition: StringKernel.h:26

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