14 #ifndef _OLIGOSTRINGKERNEL_H_
15 #define _OLIGOSTRINGKERNEL_H_
88 virtual const char*
get_name()
const {
return "OligoStringKernel"; }
112 const std::string& sequence, uint32_t k_mer_length,
113 const std::string& allowed_characters,
114 std::vector< std::pair<int32_t, float64_t> >& values);
124 const std::vector<std::string>& sequences,
125 uint32_t k_mer_length,
const std::string& allowed_characters,
126 std::vector< std::vector< std::pair<int32_t, float64_t> > >& encoded_sequences);
144 const std::vector< std::pair<int32_t, float64_t> >& x,
145 const std::vector< std::pair<int32_t, float64_t> >& y,
146 int32_t max_distance = -1);
156 const std::vector< std::pair<int32_t, float64_t> >& x,
157 const std::vector< std::pair<int32_t, float64_t> >& y);
171 void getExpFunctionCache(uint32_t sequence_length);
173 static inline bool cmpOligos_(std::pair<int32_t, float64_t> a,
174 std::pair<int32_t, float64_t> b )
176 return (a.second < b.second);
190 #endif // _OLIGOSTRINGKERNEL_H_
virtual bool init(CFeatures *l, CFeatures *r)
virtual EKernelType get_kernel_type()
float64_t kernelOligo(const std::vector< std::pair< int32_t, float64_t > > &x, const std::vector< std::pair< int32_t, float64_t > > &y)
returns the value of the oligo kernel for sequences 'x' and 'y'
virtual float64_t compute(int32_t x, int32_t y)
This class offers access to the Oligo Kernel introduced by Meinicke et al. in 2004.
SGVector< float64_t > gauss_table
int32_t cache_size
cache_size in MB
static void encodeOligo(const std::string &sequence, uint32_t k_mer_length, const std::string &allowed_characters, std::vector< std::pair< int32_t, float64_t > > &values)
encodes the signals of the sequence
virtual ~COligoStringKernel()
static void getSequences(const std::vector< std::string > &sequences, uint32_t k_mer_length, const std::string &allowed_characters, std::vector< std::vector< std::pair< int32_t, float64_t > > > &encoded_sequences)
encodes all sequences with the encodeOligo function and stores them in 'encoded_sequences' ...
virtual const char * get_name() const
all of classes and functions are contained in the shogun namespace
The class Features is the base class of all feature objects.
Template class StringKernel, is the base class of all String Kernels.
float64_t kernelOligoFast(const std::vector< std::pair< int32_t, float64_t > > &x, const std::vector< std::pair< int32_t, float64_t > > &y, int32_t max_distance=-1)
returns the value of the oligo kernel for sequences 'x' and 'y'