SHOGUN  v1.1.0
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
KRR.h
Go to the documentation of this file.
1 /*
2  * This program is free software; you can redistribute it and/or modify
3  * it under the terms of the GNU General Public License as published by
4  * the Free Software Foundation; either version 3 of the License, or
5  * (at your option) any later version.
6  *
7  * Written (W) 2006 Mikio L. Braun
8  * Written (W) 1999-2009 Soeren Sonnenburg
9  * Copyright (C) 1999-2009 Fraunhofer Institute FIRST and Max-Planck-Society
10  */
11 
12 #ifndef _KRR_H__
13 #define _KRR_H__
14 
15 #include <shogun/lib/config.h>
17 
18 #ifdef HAVE_LAPACK
19 
21 
22 namespace shogun
23 {
54 class CKRR : public CKernelMachine
55 {
56  public:
58  CKRR();
59 
66  CKRR(float64_t tau, CKernel* k, CLabels* lab);
67  virtual ~CKRR();
68 
73  inline void set_tau(float64_t t) { tau = t; };
74 
79  virtual CLabels* apply();
80 
86  virtual float64_t apply(int32_t num);
87 
93  virtual bool load(FILE* srcfile);
94 
100  virtual bool save(FILE* dstfile);
101 
107  {
108  return CT_KRR;
109  }
110 
112  inline virtual const char* get_name() const { return "KRR"; }
113 
114  protected:
123  virtual bool train_machine(CFeatures* data=NULL);
124 
125  private:
127  float64_t *alpha;
129  float64_t tau;
130 };
131 }
132 #endif // HAVE_LAPACK
133 #endif // _KRR_H__
EClassifierType
Definition: Machine.h:27
The class Labels models labels, i.e. class assignments of objects.
Definition: Labels.h:35
virtual const char * get_name() const
Definition: KRR.h:112
virtual CLabels * apply()
Definition: KRR.cpp:99
virtual bool load(FILE *srcfile)
Definition: KRR.cpp:85
A generic KernelMachine interface.
Definition: KernelMachine.h:43
virtual EClassifierType get_classifier_type()
Definition: KRR.h:106
double float64_t
Definition: common.h:56
virtual bool train_machine(CFeatures *data=NULL)
Definition: KRR.cpp:43
virtual bool save(FILE *dstfile)
Definition: KRR.cpp:92
void set_tau(float64_t t)
Definition: KRR.h:73
The class Features is the base class of all feature objects.
Definition: Features.h:56
virtual ~CKRR()
Definition: KRR.cpp:38
The Kernel base class.
Definition: Kernel.h:172
Class KRR implements Kernel Ridge Regression - a regularized least square method for classification a...
Definition: KRR.h:54

SHOGUN Machine Learning Toolbox - Documentation