Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #ifndef _REGULATORYMODULESSTRINGKERNEL_H___
00012 #define _REGULATORYMODULESSTRINGKERNEL_H___
00013
00014 #include "lib/common.h"
00015 #include "kernel/StringKernel.h"
00016 #include "features/SimpleFeatures.h"
00017
00018 namespace shogun
00019 {
00025 class CRegulatoryModulesStringKernel: public CStringKernel<char>
00026 {
00027 public:
00036 CRegulatoryModulesStringKernel(int32_t size, float64_t width, int32_t degree, int32_t shift, int32_t window);
00037
00050 CRegulatoryModulesStringKernel(CStringFeatures<char>* lstr, CStringFeatures<char>* rstr,
00051 CSimpleFeatures<uint16_t>* lpos, CSimpleFeatures<uint16_t>* rpos,
00052 float64_t width, int32_t degree, int32_t shift, int32_t window, int32_t size=10);
00053
00055 virtual ~CRegulatoryModulesStringKernel();
00056
00063 virtual bool init(CFeatures* l, CFeatures* r);
00064
00069 virtual EKernelType get_kernel_type() { return K_REGULATORYMODULES; }
00070
00075 inline virtual const char* get_name() const { return "RegulatoryModulesStringKernel"; }
00076
00082 void set_motif_positions(
00083 CSimpleFeatures<uint16_t>* positions_lhs, CSimpleFeatures<uint16_t>* positions_rhs);
00084
00085 protected:
00094 virtual float64_t compute(int32_t idx_a, int32_t idx_b);
00095
00103 float64_t compute_wds(char* avec, char* bvec, int32_t len);
00104
00105
00107 void set_wd_weights();
00108
00109 protected:
00111 float64_t width;
00112
00114 int32_t degree;
00116 int32_t shift;
00117
00119 int32_t window;
00120
00122 CSimpleFeatures<uint16_t>* motif_positions_lhs;
00123
00125 CSimpleFeatures<uint16_t>* motif_positions_rhs;
00126
00128 float64_t* position_weights;
00129
00131 float64_t* weights;
00132 };
00133 }
00134 #endif