27 int32_t size, int32_t l, int32_t
id, int32_t od)
36 SG_DEBUG(
"LIK with parms: l=%d, id=%d, od=%d created!\n", l,
id, od)
41 int32_t
id, int32_t od)
50 SG_DEBUG(
"LIK with parms: l=%d, id=%d, od=%d created!\n", len,
id, od)
69 bool free_avec, free_bvec;
74 ASSERT(alen==blen && alen>0)
80 for (i = 0; i<alen; i++)
81 match[i] = (avec[i] == bvec[i])? 1 : 0;
85 for (t = 0; t<alen-
length; t++)
88 for (i = 0; i<length && t+i+length+1<alen; i++)
89 sum += (i+1)*match[t+i]+(length-i)*match[t+i+length+1];
91 float64_t inner_sum = (sum + (length+1)*match[t+length]) / ((2*length+1)*(length+1));
93 outer_sum += inner_sum;
102 void CLocalityImprovedStringKernel::init()
virtual ~CLocalityImprovedStringKernel()
virtual bool set_normalizer(CKernelNormalizer *normalizer)
virtual bool init(CFeatures *l, CFeatures *r)
virtual bool init_normalizer()
CFeatures * rhs
feature vectors to occur on right hand side
float64_t compute(int32_t idx_a, int32_t idx_b)
all of classes and functions are contained in the shogun namespace
CFeatures * lhs
feature vectors to occur on left hand side
The class Features is the base class of all feature objects.
CLocalityImprovedStringKernel()
friend class CSqrtDiagKernelNormalizer
Template class StringKernel, is the base class of all String Kernels.