SHOGUN  3.2.1
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
KernelRidgeRegression.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 _KERNELRIDGEREGRESSION_H__
13 #define _KERNELRIDGEREGRESSION_H__
14 
15 #include <shogun/lib/config.h>
16 
17 #ifdef HAVE_LAPACK
18 
20 #include <shogun/kernel/Kernel.h>
22 
23 namespace shogun
24 {
25 
28 {
30  PINV=1,
32  GS=2
33 };
34 
66 {
67  public:
70 
73 
82 
85 
90  inline void set_tau(float64_t tau) { m_tau = tau; };
91 
96  inline void set_epsilon(float64_t epsilon) { m_epsilon = epsilon; }
97 
103  virtual bool load(FILE* srcfile);
104 
110  virtual bool save(FILE* dstfile);
111 
117  {
119  }
120 
122  virtual const char* get_name() const { return "KernelRidgeRegression"; }
123 
124  protected:
133  virtual bool train_machine(CFeatures* data=NULL);
134 
135  private:
136  void init();
137 
142  bool train_machine_gs();
143 
148  bool train_machine_pinv();
149 
150  private:
152  float64_t m_tau;
153 
155  float64_t m_epsilon;
156 
158  ETrainingType m_train_func;
159 };
160 }
161 
162 #endif // HAVE_LAPACK
163 #endif // _KERNELRIDGEREGRESSION_H__

SHOGUN Machine Learning Toolbox - Documentation