SHOGUN  4.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Modules Pages
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/lib/config.h>
16 
18 
19 namespace shogun
20 {
21 
37 {
38 public:
41 
48  CDistantSegmentsKernel(int32_t size, int32_t delta, int32_t theta);
49 
59  int32_t size, int32_t delta, int32_t theta);
60 
67  virtual bool init(CFeatures* l, CFeatures* r);
68 
73  {
74  return K_DISTANTSEGMENTS;
75  }
76 
80  virtual const char* get_name() const
81  {
82  return "DistantSegmentsKernel";
83  }
84 
85 protected:
95  virtual float64_t compute(int32_t idx_a, int32_t idx_b);
96 
97 private:
99  void init();
100 
105  int32_t bin(int32_t j, int32_t i);
106 
120  int32_t compute(char* s, int32_t sLength, char* b, int32_t bLength,
121  int32_t delta_m, int32_t theta_m);
122 
123 protected:
125  int32_t m_delta;
126 
128  int32_t m_theta;
129 
130 
131 };
132 
133 }
134 
135 #endif /* DISTANTSEGMENTSKERNEL_H_ */
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
EKernelType
Definition: Kernel.h:57
The distant segments kernel is a string kernel, which counts the number of substrings, so-called segments, at a certain distance from each other.
virtual const char * get_name() const
double float64_t
Definition: common.h:50
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
#define delta
Definition: sfa.cpp:23
virtual EKernelType get_kernel_type()
virtual bool init(CFeatures *l, CFeatures *r)

SHOGUN Machine Learning Toolbox - Documentation