19 using namespace shogun;
112 SG_ERROR(
"no estimate available\n");
117 SG_ERROR(
"number of parameters of estimate and feature representation do not match\n");
136 for (i=0; i<num_vectors; i++)
142 for (int32_t j=0; j<len; j++)
149 mean[idx] += value/num_vectors ;
155 for (i=0; i<num_vectors; i++)
161 for (int32_t j=0; j<len; j++)
163 for (int32_t k=0; k<4; k++)
203 for (int32_t j=0; j<alen; j++)
213 ld_mean_lhs[i]=result ;
229 for (int32_t j=0; j<alen; j++)
250 ld_mean_lhs = l_ld_mean_lhs ;
269 ld_mean_lhs = l_ld_mean_rhs ;
285 ld_mean_lhs = l_ld_mean_lhs ;
320 bool free_avec, free_bvec;
328 for (int32_t i=0; i<alen; i++)
330 if (avec[i]==bvec[i])
338 result += value*value/
variance[a_idx] ;
356 int32_t num_pos=0, num_neg=0;
365 SG_INFO(
"priors: pos=%1.3f (%i) neg=%1.3f (%i)\n",
366 (
float64_t) num_pos/(num_pos+num_neg), num_pos,
367 (
float64_t) num_neg/(num_pos+num_neg), num_neg);
374 void CSalzbergWordStringKernel::init()
CPluginEstimate * estimate
float64_t log_derivative_neg_obsolete(uint16_t obs, int32_t pos)
The class Labels models labels, i.e. class assignments of objects.
CSalzbergWordStringKernel()
int32_t compute_index(int32_t position, uint16_t symbol)
virtual int32_t get_num_vectors() const =0
virtual int32_t get_num_vectors() const
virtual ~CSalzbergWordStringKernel()
virtual int32_t get_vector_length(int32_t vec_num)
int32_t get_int_label(int32_t idx)
float64_t compute(int32_t idx_a, int32_t idx_b)
float64_t log_derivative_pos_obsolete(uint16_t obs, int32_t pos)
void free_feature_vector(ST *feat_vec, int32_t num, bool dofree)
void set_prior_probs_from_labels(CLabels *labels)
SGVector< ST > get_feature_vector(int32_t num)
floatmax_t get_num_symbols()
virtual bool init_normalizer()
virtual bool init(CFeatures *l, CFeatures *r)
CFeatures * rhs
feature vectors to occur on right hand side
void set_prior_probs(float64_t pos_prior_, float64_t neg_prior_)
CFeatures * lhs
feature vectors to occur on left hand side
The class Features is the base class of all feature objects.
Template class StringKernel, is the base class of all String Kernels.
#define SG_MALLOC(type, len)