CImplicitWeightedSpecFeatures Class Reference


Detailed Description

Features that compute the Weighted Spectrum Kernel feature space explicitly.

See also:
CWeightedCommWordStringKernel

Definition at line 26 of file ImplicitWeightedSpecFeatures.h.

Inheritance diagram for CImplicitWeightedSpecFeatures:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CImplicitWeightedSpecFeatures (CStringFeatures< uint16_t > *str, bool normalize=true)
 CImplicitWeightedSpecFeatures (const CImplicitWeightedSpecFeatures &orig)
virtual ~CImplicitWeightedSpecFeatures ()
virtual CFeaturesduplicate () const
virtual int32_t get_dim_feature_space ()
virtual float64_t dot (int32_t vec_idx1, int32_t vec_idx2)
virtual float64_t dense_dot (int32_t vec_idx1, const float64_t *vec2, int32_t vec2_len)
virtual void add_to_dense_vec (float64_t alpha, int32_t vec_idx1, float64_t *vec2, int32_t vec2_len, bool abs_val=false)
virtual int32_t get_nnz_features_for_vector (int32_t num)
virtual EFeatureType get_feature_type ()
virtual EFeatureClass get_feature_class ()
virtual int32_t get_num_vectors ()
virtual int32_t get_size ()
bool set_wd_weights ()
bool set_weights (float64_t *w, int32_t d)
virtual const char * get_name () const

Protected Member Functions

void compute_normalization_const ()

Protected Attributes

CStringFeatures< uint16_t > * strings
float64_tnormalization_factors
int32_t num_strings
int32_t alphabet_size
int32_t degree
int32_t spec_size
float64_tspec_weights

Constructor & Destructor Documentation

CImplicitWeightedSpecFeatures::CImplicitWeightedSpecFeatures ( CStringFeatures< uint16_t > *  str,
bool  normalize = true 
)

constructor

Parameters:
str stringfeatures (of words)
normalize whether to use sqrtdiag normalization

Definition at line 14 of file ImplicitWeightedSpecFeatures.cpp.

CImplicitWeightedSpecFeatures::CImplicitWeightedSpecFeatures ( const CImplicitWeightedSpecFeatures orig  ) 

copy constructor

Definition at line 76 of file ImplicitWeightedSpecFeatures.cpp.

CImplicitWeightedSpecFeatures::~CImplicitWeightedSpecFeatures (  )  [virtual]

Definition at line 84 of file ImplicitWeightedSpecFeatures.cpp.


Member Function Documentation

void CImplicitWeightedSpecFeatures::add_to_dense_vec ( float64_t  alpha,
int32_t  vec_idx1,
float64_t vec2,
int32_t  vec2_len,
bool  abs_val = false 
) [virtual]

add vector 1 multiplied with alpha to dense vector2

Parameters:
alpha scalar alpha
vec_idx1 index of first vector
vec2 pointer to real valued vector
vec2_len length of real valued vector
abs_val if true add the absolute value

Implements CDotFeatures.

Definition at line 180 of file ImplicitWeightedSpecFeatures.cpp.

void CImplicitWeightedSpecFeatures::compute_normalization_const (  )  [protected]

compute the sqrt diag normalization constant per string

See also:
CSqrtDiagKernelNormalization

Definition at line 33 of file ImplicitWeightedSpecFeatures.cpp.

float64_t CImplicitWeightedSpecFeatures::dense_dot ( int32_t  vec_idx1,
const float64_t vec2,
int32_t  vec2_len 
) [virtual]

compute dot product between vector1 and a dense vector

Parameters:
vec_idx1 index of first vector
vec2 pointer to real valued vector
vec2_len length of real valued vector

Implements CDotFeatures.

Definition at line 144 of file ImplicitWeightedSpecFeatures.cpp.

float64_t CImplicitWeightedSpecFeatures::dot ( int32_t  vec_idx1,
int32_t  vec_idx2 
) [virtual]

compute dot product between vector1 and vector2, appointed by their indices

Parameters:
vec_idx1 index of first vector
vec_idx2 index of second vector

Implements CDotFeatures.

Definition at line 91 of file ImplicitWeightedSpecFeatures.cpp.

CFeatures * CImplicitWeightedSpecFeatures::duplicate (  )  const [virtual]

duplicate feature object

Returns:
feature object

Implements CFeatures.

Definition at line 209 of file ImplicitWeightedSpecFeatures.cpp.

virtual int32_t CImplicitWeightedSpecFeatures::get_dim_feature_space (  )  [virtual]

obtain the dimensionality of the feature space

(not mix this up with the dimensionality of the input space, usually obtained via get_num_features())

Returns:
dimensionality

Implements CDotFeatures.

Definition at line 55 of file ImplicitWeightedSpecFeatures.h.

virtual EFeatureClass CImplicitWeightedSpecFeatures::get_feature_class (  )  [virtual]

get feature class

Returns:
feature class

Implements CFeatures.

Definition at line 110 of file ImplicitWeightedSpecFeatures.h.

virtual EFeatureType CImplicitWeightedSpecFeatures::get_feature_type (  )  [virtual]

get feature type

Returns:
templated feature type

Implements CFeatures.

Definition at line 101 of file ImplicitWeightedSpecFeatures.h.

virtual const char* CImplicitWeightedSpecFeatures::get_name (  )  const [virtual]
Returns:
object name

Implements CSGObject.

Definition at line 148 of file ImplicitWeightedSpecFeatures.h.

virtual int32_t CImplicitWeightedSpecFeatures::get_nnz_features_for_vector ( int32_t  num  )  [virtual]

get number of non-zero features in vector

Parameters:
num which vector
Returns:
number of non-zero features in vector

Implements CDotFeatures.

Definition at line 91 of file ImplicitWeightedSpecFeatures.h.

virtual int32_t CImplicitWeightedSpecFeatures::get_num_vectors (  )  [virtual]

get number of strings

Returns:
number of strings

Implements CFeatures.

Definition at line 119 of file ImplicitWeightedSpecFeatures.h.

virtual int32_t CImplicitWeightedSpecFeatures::get_size (  )  [virtual]

get size of one element

Returns:
size of one element

Implements CFeatures.

Definition at line 128 of file ImplicitWeightedSpecFeatures.h.

bool CImplicitWeightedSpecFeatures::set_wd_weights (  ) 

set weighted degree weights

Returns:
if setting was successful

Definition at line 44 of file ImplicitWeightedSpecFeatures.cpp.

bool CImplicitWeightedSpecFeatures::set_weights ( float64_t w,
int32_t  d 
)

set custom weights (swig compatible)

Parameters:
w weights
d degree (must match number of weights)
Returns:
if setting was successful

Definition at line 65 of file ImplicitWeightedSpecFeatures.cpp.


Member Data Documentation

size of alphabet

Definition at line 166 of file ImplicitWeightedSpecFeatures.h.

degree

Definition at line 169 of file ImplicitWeightedSpecFeatures.h.

use sqrtdiag normalization

Definition at line 162 of file ImplicitWeightedSpecFeatures.h.

number of strings

Definition at line 164 of file ImplicitWeightedSpecFeatures.h.

size of k-mer spectrum

Definition at line 171 of file ImplicitWeightedSpecFeatures.h.

weights for each of the subkernels of degree 1...d

Definition at line 174 of file ImplicitWeightedSpecFeatures.h.

reference to strings

Definition at line 159 of file ImplicitWeightedSpecFeatures.h.


The documentation for this class was generated from the following files:

SHOGUN Machine Learning Toolbox - Documentation