Public Member Functions | Protected Attributes

CZeroMeanCenterKernelNormalizer Class Reference


Detailed Description

ZeroMeanCenterKernelNormalizer centers the kernel in feature space.

After centering, each feature must have zero mean. The centered kernel matrix can be expressed in terms of the non-centered version.

Denoting the mapping from input space to feature space by $\phi:\mathcal{X}\rightarrow\mathcal{F}$, the centered square kernel matrix $K_c$ (with dimensionality $ M $)

can be expressed in terms of the original matrix $K$ as follows:

\begin{eqnarray*} k({\bf x}_i,{\bf x}_j)_c & = & \left(\phi({\bf x}_i) - \frac{1}{m} \sum_{p=1}^M \phi({\bf x}_p)\right) \cdot \left(\phi({\bf x}_j) - \frac{1}{M} \sum_{q=1}^M \phi({\bf x}_q)\right) \\ & = & K_{ij} - \frac{1}{M} \sum_{p=1}^M K_{pj} - \frac{1}{M} \sum_{q=1}^M K_{iq} + \frac{1}{M^2} \sum_{p=1}^M \sum_{q=1}^M K_{pq} \\ & = & (K - 1_M K - K 1_M + 1_M K 1_M)_{ij} \end{eqnarray*}

Additionally, let $ K^{t} $ be the $ L \times M $ test matrix describing the similarity between a $ L $ test instances with $M$ training instances

(defined by a $ M x M $ kernel matrix $ K$), the centered testing set kernel matrix is given by

\[ K_{c}^t = (K - 1'_M K - K^{t} 1_M + 1'_M K 1_M) \]

Definition at line 41 of file ZeroMeanCenterKernelNormalizer.h.

Inheritance diagram for CZeroMeanCenterKernelNormalizer:
Inheritance graph
[legend]

List of all members.

Public Member Functions

 CZeroMeanCenterKernelNormalizer ()
virtual ~CZeroMeanCenterKernelNormalizer ()
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)
bool alloc_and_compute_row_means (CKernel *k, float64_t *&v, int32_t num_lhs, int32_t num_rhs)
virtual const char * get_name () const

Protected Attributes

float64_tktrain_row_means
int32_t num_ktrain
float64_tktest_row_means
int32_t num_ktest
float64_t ktrain_mean

Constructor & Destructor Documentation

default constructor

Definition at line 46 of file ZeroMeanCenterKernelNormalizer.h.

virtual ~CZeroMeanCenterKernelNormalizer (  )  [virtual]

default destructor

Definition at line 57 of file ZeroMeanCenterKernelNormalizer.h.


Member Function Documentation

bool alloc_and_compute_row_means ( CKernel k,
float64_t *&  v,
int32_t  num_lhs,
int32_t  num_rhs 
)

alloc and compute the vector containing the row margins of all rows for a kernel matrix.

Definition at line 135 of file ZeroMeanCenterKernelNormalizer.h.

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

Implements CSGObject.

Definition at line 150 of file ZeroMeanCenterKernelNormalizer.h.

virtual bool init ( CKernel k  )  [virtual]

initialization of the normalizer

Parameters:
k kernel

Implements CKernelNormalizer.

Definition at line 65 of file ZeroMeanCenterKernelNormalizer.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 104 of file ZeroMeanCenterKernelNormalizer.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 115 of file ZeroMeanCenterKernelNormalizer.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 125 of file ZeroMeanCenterKernelNormalizer.h.


Member Data Documentation

float64_t* ktest_row_means [protected]

test row means

Definition at line 160 of file ZeroMeanCenterKernelNormalizer.h.

float64_t ktrain_mean [protected]

train mean

Definition at line 166 of file ZeroMeanCenterKernelNormalizer.h.

train row means

Definition at line 154 of file ZeroMeanCenterKernelNormalizer.h.

int32_t num_ktest [protected]

num k test

Definition at line 163 of file ZeroMeanCenterKernelNormalizer.h.

int32_t num_ktrain [protected]

num k train

Definition at line 157 of file ZeroMeanCenterKernelNormalizer.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