SHOGUN  v3.2.0
StringSubsequenceKernel.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) 2014 Soumyajit De
8  */
9 
10 #ifndef STRING_SUBSEQUENCE_KERNEL_H_
11 #define STRING_SUBSEQUENCE_KERNEL_H_
12 
13 #include <shogun/lib/common.h>
15 
16 namespace shogun
17 {
54 {
55 public:
58 
66  CStringSubsequenceKernel(int32_t size, int32_t maxlen, float64_t lambda);
67 
77  int32_t maxlen, float64_t lambda);
78 
80  virtual ~CStringSubsequenceKernel();
81 
89  virtual bool init(CFeatures* lhs, CFeatures* rhs);
90 
92  virtual void cleanup();
93 
96  {
97  return K_POLYMATCH;
98  }
99 
101  virtual const char* get_name() const
102  {
103  return "StringSubsequenceKernel";
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 
139 };
140 
141 }
142 #endif // STRING_SUBSEQUENCE_KERNEL_H_
class StringSubsequenceKernel that implements String Subsequence Kernel (SSK) discussed by Lodhi et...
EKernelType
Definition: Kernel.h:51
virtual float64_t compute(int32_t idx_a, int32_t idx_b)
virtual bool init(CFeatures *lhs, CFeatures *rhs)
double float64_t
Definition: common.h:48
virtual const char * get_name() const
CFeatures * rhs
feature vectors to occur on right hand side
Definition: Kernel.h:706
all of classes and functions are contained in the shogun namespace
Definition: class_list.h:16
CFeatures * lhs
feature vectors to occur on left hand side
Definition: Kernel.h:704
The class Features is the base class of all feature objects.
Definition: Features.h:62
Template class StringKernel, is the base class of all String Kernels.
Definition: StringKernel.h:24

SHOGUN Machine Learning Toolbox - Documentation