Public Member Functions | Protected Attributes

CTanimotoKernelNormalizer Class Reference


Detailed Description

TanimotoKernelNormalizer performs kernel normalization inspired by the Tanimoto coefficient (see http://en.wikipedia.org/wiki/Jaccard_index ).

\[ k'({\bf x},{\bf x'}) = \frac{k({\bf x},{\bf x'})}{k({\bf x},{\bf x})+k({\bf x'},{\bf x'})-k({\bf x},{\bf x'})} \]

Definition at line 26 of file TanimotoKernelNormalizer.h.

Inheritance diagram for CTanimotoKernelNormalizer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CTanimotoKernelNormalizer (bool use_opt_diag=false)
virtual ~CTanimotoKernelNormalizer ()
virtual bool init (CKernel *k)
virtual float64_t normalize (float64_t value, int32_t idx_lhs, int32_t idx_rhs)
virtual float64_t normalize_lhs (float64_t value, int32_t idx_lhs)
virtual float64_t normalize_rhs (float64_t value, int32_t idx_rhs)
virtual const char * get_name (void) const
bool alloc_and_compute_diag (CKernel *k, float64_t *&v, int32_t num)

Protected Attributes

float64_tdiag_lhs
float64_tdiag_rhs
bool use_optimized_diagonal_computation

Constructor & Destructor Documentation

CTanimotoKernelNormalizer ( bool  use_opt_diag = false  ) 

default constructor

Parameters:
use_opt_diag - some kernels support faster diagonal compuation via compute_diag(idx), this flag enables this

Definition at line 33 of file TanimotoKernelNormalizer.h.

virtual ~CTanimotoKernelNormalizer (  )  [virtual]

default destructor

Definition at line 40 of file TanimotoKernelNormalizer.h.


Member Function Documentation

bool alloc_and_compute_diag ( CKernel k,
float64_t *&  v,
int32_t  num 
)

alloc and compute the vector containing the square root of the diagonal elements of this kernel.

Definition at line 118 of file TanimotoKernelNormalizer.h.

virtual const char* get_name ( void   )  const [virtual]

Returns the name of the SGSerializable instance. It MUST BE the CLASS NAME without the prefixed `C'.

Returns:
name of the SGSerializable

Implements CSGObject.

Definition at line 110 of file TanimotoKernelNormalizer.h.

virtual bool init ( CKernel k  )  [virtual]

initialization of the normalizer

Parameters:
k kernel

Implements CKernelNormalizer.

Definition at line 48 of file TanimotoKernelNormalizer.h.

virtual float64_t normalize ( float64_t  value,
int32_t  idx_lhs,
int32_t  idx_rhs 
) [virtual]

normalize the kernel value

Parameters:
value kernel value
idx_lhs index of left hand side vector
idx_rhs index of right hand side vector

Implements CKernelNormalizer.

Definition at line 78 of file TanimotoKernelNormalizer.h.

virtual float64_t normalize_lhs ( float64_t  value,
int32_t  idx_lhs 
) [virtual]

normalize only the left hand side vector

Parameters:
value value of a component of the left hand side feature vector
idx_lhs index of left hand side vector

Implements CKernelNormalizer.

Definition at line 89 of file TanimotoKernelNormalizer.h.

virtual float64_t normalize_rhs ( float64_t  value,
int32_t  idx_rhs 
) [virtual]

normalize only the right hand side vector

Parameters:
value value of a component of the right hand side feature vector
idx_rhs index of right hand side vector

Implements CKernelNormalizer.

Definition at line 99 of file TanimotoKernelNormalizer.h.


Member Data Documentation

float64_t* diag_lhs [protected]

diagonal left-hand side

Definition at line 144 of file TanimotoKernelNormalizer.h.

float64_t* diag_rhs [protected]

diagonal right-hand side

Definition at line 146 of file TanimotoKernelNormalizer.h.

flat if optimized diagonal computation is used

Definition at line 148 of file TanimotoKernelNormalizer.h.


The documentation for this class was generated from the following file:
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Defines

SHOGUN Machine Learning Toolbox - Documentation