CKRR Class Reference

Inheritance diagram for CKRR:

Inheritance graph
[legend]

List of all members.

Public Member Functions

 CKRR ()
 CKRR (float64_t tau, CKernel *k, CLabels *lab)
virtual ~CKRR ()
void set_tau (float64_t t)
virtual bool train ()
virtual CLabelsclassify (CLabels *output=NULL)
virtual float64_t classify_example (int32_t num)
virtual bool load (FILE *srcfile)
virtual bool save (FILE *dstfile)
virtual EClassifierType get_classifier_type ()


Detailed Description

Class KRR implements Kernel Ridge Regression - a regularized least square method for classification and regression. It is similar to support vector machines (cf. CSVM). However in contrast to SVMs a different objective is optimized that leads to a dense solution (thus not only a few support vectors are active in the end but all training examples). This makes it only applicable to rather few training examples. In case a linear kernel is used RR is closely related to Fishers Linear Discriminant (cf. LDA).

Internally (for linear kernels) it is solved via minimizing the following system

\[ \frac{1}{2}\left(\sum_{i=1}^N(y_i-{\bf w}\cdot {\bf x}_i)^2 + \tau||{\bf w}||^2\right) \]

which is boils down to solving a linear system

\[ {\bf w} = \left(\tau {\bf I}+ \sum_{i=1}^N{\bf x}_i{\bf x}_i^T\right)^{-1}\left(\sum_{i=1}^N y_i{\bf x}_i\right) \]

and in the kernel case

\[ {\bf \alpha}=\left({\bf K}+\tau{\bf I}\right)^{-1}{\bf y} \]

where K is the kernel matrix and y the vector of labels. The expressed solution can again be written as a linear combination of kernels (cf. CKernelMachine) with bias $b=0$.

Definition at line 50 of file KRR.h.


Constructor & Destructor Documentation

CKRR::CKRR (  ) 

default constructor

Definition at line 19 of file KRR.cpp.

CKRR::CKRR ( float64_t  tau,
CKernel k,
CLabels lab 
)

constructor

Parameters:
tau regularization constant tau
k kernel
lab labels

Definition at line 26 of file KRR.cpp.

CKRR::~CKRR (  )  [virtual]

Definition at line 36 of file KRR.cpp.


Member Function Documentation

CLabels * CKRR::classify ( CLabels output = NULL  )  [virtual]

classify regression

Parameters:
output resulting labels
Returns:
resulting labels

Reimplemented from CKernelMachine.

Definition at line 78 of file KRR.cpp.

float64_t CKRR::classify_example ( int32_t  num  )  [virtual]

classify one example

Parameters:
num which example to classify
Returns:
result

Reimplemented from CClassifier.

Definition at line 114 of file KRR.cpp.

virtual EClassifierType CKRR::get_classifier_type (  )  [virtual]

get classifier type

Returns:
classifier type KRR

Reimplemented from CClassifier.

Definition at line 109 of file KRR.h.

bool CKRR::load ( FILE *  srcfile  )  [virtual]

load regression from file

Parameters:
srcfile file to load from
Returns:
if loading was successful

Reimplemented from CClassifier.

Definition at line 68 of file KRR.cpp.

bool CKRR::save ( FILE *  dstfile  )  [virtual]

save regression to file

Parameters:
dstfile file to save to
Returns:
if saving was successful

Reimplemented from CClassifier.

Definition at line 73 of file KRR.cpp.

void CKRR::set_tau ( float64_t  t  ) 

set regularization constant

Parameters:
t new tau

Definition at line 69 of file KRR.h.

bool CKRR::train (  )  [virtual]

train regression

Returns:
if training was successful

Reimplemented from CClassifier.

Definition at line 41 of file KRR.cpp.


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

SHOGUN Machine Learning Toolbox - Documentation