14 #ifndef _OLIGOSTRINGKERNEL_H_ 15 #define _OLIGOSTRINGKERNEL_H_ 86 virtual const char*
get_name()
const {
return "OligoStringKernel"; }
110 const std::string& sequence, uint32_t k_mer_length,
111 const std::string& allowed_characters,
112 std::vector< std::pair<int32_t, float64_t> >& values);
122 const std::vector<std::string>& sequences,
123 uint32_t k_mer_length,
const std::string& allowed_characters,
124 std::vector< std::vector< std::pair<int32_t, float64_t> > >& encoded_sequences);
142 const std::vector< std::pair<int32_t, float64_t> >& x,
143 const std::vector< std::pair<int32_t, float64_t> >& y,
144 int32_t max_distance = -1);
154 const std::vector< std::pair<int32_t, float64_t> >& x,
155 const std::vector< std::pair<int32_t, float64_t> >& y);
169 void getExpFunctionCache(uint32_t sequence_length);
171 static inline bool cmpOligos_(std::pair<int32_t, float64_t> a,
172 std::pair<int32_t, float64_t> b )
174 return (a.second < b.second);
188 #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'